Skip to content

Commit

Permalink
fix: don't double-negate negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
arlyon committed May 22, 2023
1 parent b387b94 commit fc7c0d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions crates/tailwind-parse/src/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ impl<'a> Expression<'a> {
..
})) = prop
{
let (negative, p_value) = if self.negative && value.starts_with('-') {
(false, value.trim_start_matches('-'))
} else if self.negative {
(true, value.as_ref())
} else {
(false, value.as_ref())
};
*value = format!(
"{}{}{}",
if self.negative { "-" } else { "" },
value,
if negative { "-" } else { "" },
p_value,
if self.important { " !important" } else { "" }
)
.into();
Expand Down

0 comments on commit fc7c0d0

Please sign in to comment.