tailwind_css_fixes/modules/flexbox/justify/justify_self/
mod.rs1use super::*;
2
3#[doc=include_str!("readme.md")]
4#[derive(Debug, Clone)]
5pub struct TailwindJustifySelf {
6 kind: StandardValue,
7}
8
9crate::macros::sealed::keyword_instance!(TailwindJustifySelf => "justify-self");
10
11impl Display for TailwindJustifySelf {
12 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
13 write!(f, "justify-self-{}", self.kind)
14 }
15}
16
17impl TailwindJustifySelf {
18 pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary) -> Result<Self> {
20 Ok(Self { kind: StandardValue::parser("justify-self", &Self::check_valid)(pattern, arbitrary)? })
21 }
22 pub fn parse_arbitrary(arbitrary: &TailwindArbitrary) -> Result<Self> {
24 StandardValue::parse_arbitrary(arbitrary).map(|kind| Self { kind })
25 }
26 pub fn check_valid(mode: &str) -> bool {
28 let set = BTreeSet::from_iter(vec![
29 "auto",
30 "baseline",
31 "center",
32 "end",
33 "flex-end",
34 "flex-start",
35 "inherit",
36 "initial",
37 "left",
38 "normal",
39 "revert",
40 "right",
41 "self-end",
42 "self-start",
43 "start",
44 "stretch",
45 "unset",
46 ]);
47 set.contains(mode)
48 }
49}