tailwind_css_fixes/modules/flexbox/place/place_self/
mod.rs1use super::*;
2
3#[doc=include_str!("readme.md")]
4#[derive(Debug, Clone)]
5pub struct TailwindPlaceSelf {
6 kind: StandardValue,
7}
8
9crate::macros::sealed::keyword_instance!(TailwindPlaceSelf => "place-self");
10
11impl Display for TailwindPlaceSelf {
12 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
13 write!(f, "place-self-{}", self.kind)
14 }
15}
16
17impl TailwindPlaceSelf {
18 pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary) -> Result<Self> {
20 Ok(Self { kind: StandardValue::parser("place-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 "center",
30 "end",
31 "flex-end",
32 "flex-start",
33 "inherit",
34 "initial",
35 "normal",
36 "revert",
37 "space-around",
38 "space-between",
39 "space-evenly",
40 "start",
41 "stretch",
42 "unset",
43 ]);
44 set.contains(mode)
45 }
46}