tailwind_css_fixes/modules/layouts/breaking/before/
mod.rs

1use super::*;
2
3#[doc=include_str!("readme.md")]
4#[derive(Clone, Debug)]
5pub struct TailwindBreakBefore {
6    kind: StandardValue,
7}
8
9crate::macros::sealed::keyword_instance!(TailwindBreakBefore => "break-before");
10
11impl Display for TailwindBreakBefore {
12    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
13        write!(f, "break-before-{}", self.kind)
14    }
15}
16
17impl TailwindBreakBefore {
18    /// <https://tailwindcss.com/docs/break-before>
19    pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary) -> Result<Self> {
20        Ok(Self { kind: StandardValue::parser("break-before", &Self::check_valid)(pattern, arbitrary)? })
21    }
22
23    pub fn parse_arbitrary(arbitrary: &TailwindArbitrary) -> Result<Self> {
24        StandardValue::parse_arbitrary(arbitrary).map(|kind| Self { kind })
25    }
26    /// https://developer.mozilla.org/en-US/docs/Web/CSS/break-before#syntax
27    pub fn check_valid(mode: &str) -> bool {
28        TailwindBreakAfter::check_valid(mode)
29    }
30}