Skip to content

Commit

Permalink
Fix prefixing duplicate properties
Browse files Browse the repository at this point in the history
Fixes #537, closes #553

Co-authored-by: LeoniePhiline <22329650+LeoniePhiline@users.noreply.github.com>
  • Loading branch information
devongovett and LeoniePhiline committed Aug 19, 2023
1 parent 4417942 commit 94f254c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
18 changes: 18 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24019,6 +24019,24 @@ mod tests {
..Browsers::default()
},
);
prefix_test(
r#"
.foo {
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
"#,
indoc! {r#"
.foo {
-webkit-backdrop-filter: blur(8px);
backdrop-filter: blur(8px);
}
"#},
Browsers {
safari: Some(16 << 16),
..Browsers::default()
},
);

prefix_test(
".foo { filter: var(--foo) }",
Expand Down
7 changes: 3 additions & 4 deletions src/properties/prefix_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ macro_rules! define_fallbacks {
$(
Property::$name(val $(, mut $p)?) => {
let mut val = val.clone();
$(
$p = context.targets.prefixes($p, Feature::$name);
)?
if paste::paste! { self.[<$name:snake>] }.is_none() {
$(
$p = context.targets.prefixes($p, Feature::$name);
)?

let fallbacks = val.get_fallbacks(context.targets);
#[allow(unused_variables)]
let has_fallbacks = !fallbacks.is_empty();
Expand Down

0 comments on commit 94f254c

Please sign in to comment.