peacock_crest/style/prop_validation/
justify_content.rs1use super::{CssValue, TokenExpected};
2use crate::Unit;
3
4#[derive(Debug, Clone)]
5pub struct CssJustifyContent(Unit);
6
7#[derive(Debug, Clone, strum_macros::EnumString, strum_macros::Display)]
8pub enum KeywordJustifyContent {
9 #[strum(to_string = "left", serialize = "left")]
10 Left,
11
12 #[strum(to_string = "center", serialize = "center")]
13 Center,
14
15 #[strum(to_string = "right", serialize = "right")]
16 Right,
17}
18
19impl From<Unit> for CssJustifyContent {
20 fn from(value: Unit) -> Self {
21 Self(value)
22 }
23}
24
25impl Into<Unit> for CssJustifyContent {
26 fn into(self) -> Unit {
27 self.0
28 }
29}
30
31impl CssValue for CssJustifyContent {
32 type Keyword = KeywordJustifyContent;
33
34 fn type_name() -> &'static str {
35 "CssJustifyContent"
36 }
37
38 fn type_token() -> TokenExpected {
39 TokenExpected::Ident
40 }
41}