| 53 | } |
| 54 | |
| 55 | std::optional<YGAlign> mapAlign(std::string_view align) { |
| 56 | switch (Switch::hash(align)) { |
| 57 | case "flex-start"_hash: return YGAlignFlexStart; |
| 58 | case "center"_hash: return YGAlignCenter; |
| 59 | case "flex-end"_hash: return YGAlignFlexEnd; |
| 60 | case "stretch"_hash: return YGAlignStretch; |
| 61 | case "auto"_hash: return YGAlignAuto; |
| 62 | } |
| 63 | Warn("invalid CSS Align: \"{}\", should be one of \"flex-start\", \"center\", \"flex-end\", \"stretch\" and \"auto\"", align); |
| 64 | return std::nullopt; |
| 65 | } |
| 66 | |
| 67 | std::optional<YGFlexDirection> mapFlexDirection(std::string_view flexDirection) { |
| 68 | switch (Switch::hash(flexDirection)) { |