Skip to content

Commit

Permalink
feat: add stroke plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Jan 19, 2023
1 parent 2eaecc3 commit 4cfbaed
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/tailwind-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ pub struct TailwindTheme<'a> {
#[serde(borrow, alias = "animation")]
pub animation: HashMap<&'a str, &'a str>,

#[serde(borrow, alias = "strokeWidth")]
pub stroke_width: HashMap<&'a str, &'a str>,

#[serde(borrow, alias = "aspectRatio")]
pub aspect_ratio: HashMap<&'a str, &'a str>,
}
Expand Down
4 changes: 4 additions & 0 deletions crates/tailwind-parse/src/eval/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ fn simple_lookup_map<'a, V>(
})
}

lookup_plugin_arbitrary!(stroke_width, stroke_width, "strokeWidth");
lookup_plugin_arbitrary!(stroke_color, colors, "stroke");
merge_plugins_arbitrary!(stroke, stroke_width, stroke_color);

lookup_plugin_opt!(transition, transition_property, "transitionProperty");
lookup_plugin!(delay, transition_delay, "transitionDelay");
lookup_plugin_opt!(duration, transition_duration, "transitionDuration");
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 @@ -137,6 +137,7 @@ impl<'a> Literal<'a> {
Shrink => Optional(plugin::shrink),
Basis => Required(plugin::basis),
Italic => Singular(plugin::italic),
Stroke => RequiredArbitrary(plugin::stroke),
Justify => Required(plugin::justify),
Items => Required(plugin::items),
Gap(None) => RequiredArbitrary(plugin::gap),
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 @@ -62,6 +62,7 @@ mod plugin {
Mx,
My,
Ml,
Stroke,
Mr,
Mt,
#[rename("origin")]
Expand Down

0 comments on commit 4cfbaed

Please sign in to comment.