Skip to content

Commit

Permalink
feat: support border-s and border-e plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed May 22, 2023
1 parent fc7c0d0 commit 22041b3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions crates/tailwind-parse/src/eval/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,24 @@ merge_plugins!(border_y, alpha arb opt border_t, alpha arb opt border_b);
merge_plugins!(border_ws, arb opt border_width, border_style);
merge_plugins!(border_inner, alpha arb border_color, arb opt border_ws);

lookup_color_plugin_arbitrary!(
border_sc,
colors,
"borderInlineStartColor",
"--tw-border-opacity"
);
lookup_color_plugin_arbitrary!(
border_ec,
colors,
"borderInlineEndColor",
"--tw-border-opacity"
);
lookup_plugin_arbitrary!(border_sw, border_width, "borderInlineStartWidth");
lookup_plugin_arbitrary!(border_ew, border_width, "borderInlineEndWidth");

merge_plugins!(border_s, alpha arb border_sc, arb border_sw);
merge_plugins!(border_e, alpha arb border_ec, arb border_ew);

merge_plugins!(inset_x, arb left, arb right);
merge_plugins!(inset_y, arb top, arb bottom);
merge_plugins!(inset, arb inset_x, arb inset_y);
Expand Down Expand Up @@ -671,6 +689,8 @@ pub fn border<'a>(
Some(Border::R) => border_r,
Some(Border::X) => border_x,
Some(Border::Y) => border_y,
Some(Border::S) => return border_s(rest.ok_or_else(|| vec![])?, theme, alpha),
Some(Border::E) => return border_e(rest.ok_or_else(|| vec![])?, theme, alpha),
Some(Border::Spacing) => {
let value = rest.ok_or_else(|| vec![])?;
let spacing = theme.spacing.get(value.as_str()).ok_or_else(|| vec![])?;
Expand Down
2 changes: 2 additions & 0 deletions crates/tailwind-parse/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ mod plugin {
X,
Y,
Spacing,
S,
E,
}
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
pub enum Min {
Expand Down

0 comments on commit 22041b3

Please sign in to comment.