Skip to content

Commit

Permalink
feat: add float plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Dec 5, 2022
1 parent 6347a8f commit d873b2f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/tailwind-parse/src/eval/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,15 @@ pub fn align(Value(rest): &Value, _theme: &TailwindTheme) -> Option<ObjectLit> {
}
}

pub fn float(Value(rest): &Value, _theme: &TailwindTheme) -> Option<ObjectLit> {
match *rest {
"left" => Some(to_lit(&[("float", "left")])),
"right" => Some(to_lit(&[("float", "right")])),
"none" => Some(to_lit(&[("float", "none")])),
_ => None,
}
}

pub fn rounded(
subcommand: Option<Rounded>,
rest: &Option<SubjectValue>,
Expand Down
1 change: 1 addition & 0 deletions crates/tailwind-parse/src/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ impl<'a> Literal<'a> {
Translate => Required(plugin::translate),
Tracking => RequiredArbitrary(plugin::tracking),
Invert => Optional(plugin::invert),
Float => Required(plugin::float),
Space => Required(plugin::space),
Transform => Optional(plugin::transform),
Opacity => Required(plugin::opacity),
Expand Down
1 change: 1 addition & 0 deletions crates/tailwind-parse/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ mod plugin {
Grid(Option<Grid>),
Col,
Row,
Float,
Grow,
Shrink,
Basis,
Expand Down

0 comments on commit d873b2f

Please sign in to comment.