Skip to content

Commit

Permalink
add cursor plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed Aug 19, 2022
1 parent 715f623 commit a0a81fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config.rs
Expand Up @@ -21,6 +21,8 @@ pub struct TailwindTheme<'a> {
#[serde(borrow)]
pub spacing: HashMap<&'a str, &'a str>,
#[serde(borrow)]
pub cursor: HashMap<&'a str, &'a str>,
#[serde(borrow)]
pub colors: HashMap<&'a str, &'a str>,
#[serde(borrow, alias = "fontFamily")]
pub font_family: HashMap<&'a str, Vec<Cow<'a, str>>>,
Expand Down
1 change: 1 addition & 0 deletions src/parse/literal.rs
Expand Up @@ -15,6 +15,7 @@ pub fn parse_literal<'a>(theme: &TailwindTheme, s: &'a str) -> Result<ObjectLit,
"ease" => plugin::ease,
"border" => plugin::border,
"rounded" => plugin::rounded,
"cursor" => plugin::cursor,
"bg" => plugin::bg,
"h" => plugin::h,
"w" => plugin::w,
Expand Down
4 changes: 4 additions & 0 deletions src/plugin.rs
Expand Up @@ -94,6 +94,10 @@ pub fn rounded(rest: &str, theme: &TailwindTheme) -> Option<ObjectLit> {
simple_lookup(&theme.border_radius, rest, "borderRadius")
}

pub fn cursor(rest: &str, theme: &TailwindTheme) -> Option<ObjectLit> {
simple_lookup(&theme.cursor, rest, "cursor")
}

pub fn bg(rest: &str, theme: &TailwindTheme) -> Option<ObjectLit> {
simple_lookup(&theme.colors, rest, "backgroundColor")
}
Expand Down

0 comments on commit a0a81fb

Please sign in to comment.