Skip to content

Commit

Permalink
feat: add antialiased plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Jan 19, 2023
1 parent f6d7a79 commit d22886d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/tailwind-parse/src/eval/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ pub fn rounded<'a>(
fun(rest.as_ref(), theme)
}

pub fn antialiased() -> ObjectLit {
to_lit(&[
("-webkit-font-smoothing", "antialiased"),
("-moz-osx-font-smoothing", "grayscale"),
])
}

pub fn mix<'a>(rest: &Value, theme: &'a TailwindTheme) -> PluginResult<'a> {
match rest.0.split_once('-') {
Some(("blend", rest)) => blend(&Value(rest), theme),
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 @@ -150,6 +150,7 @@ impl<'a> Literal<'a> {
Select => Required(plugin::select),
Top => RequiredArbitrary(plugin::top),
Bottom => RequiredArbitrary(plugin::bottom),
Antialiased => Singular(plugin::antialiased),
Left => RequiredArbitrary(plugin::left),
Right => RequiredArbitrary(plugin::right),
Tracking => RequiredArbitrary(plugin::tracking),
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 @@ -108,6 +108,7 @@ mod plugin {
Leading,
Gap(Option<Gap>),
Cursor,
Antialiased,
Scale,
Box,
Select,
Expand Down

0 comments on commit d22886d

Please sign in to comment.