tailwind_css_fixes/modules/layouts/placement/
top.rs1use super::*;
2
3#[doc=include_str!("readme.md")]
4#[derive(Clone, Debug)]
5pub struct TailwindTop {
6 kind: UnitValue,
7}
8
9impl Display for TailwindTop {
10 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
11 self.kind.write_negative(f)?;
12 self.kind.write_class(f, "top-")
13 }
14}
15
16impl TailwindInstance for TailwindTop {
17 fn attributes(&self, _: &TailwindBuilder) -> CssAttributes {
18 css_attributes! {
19 "top" => self.kind.get_properties_rem()
20 }
21 }
22}
23
24impl TailwindTop {
25 pub fn parse(pattern: &[&str], arbitrary: &TailwindArbitrary, negative: Negative) -> Result<Self> {
27 let kind = get_kind_px_full_auto_fract("top", pattern, arbitrary, negative)?;
28 Ok(Self { kind })
29 }
30 pub fn check_valid(mode: &str) -> bool {
32 check_valid_auto(mode)
33 }
34}