Skip to content

Commit 0033041

Browse files
fix: 🐛 deprecated operator
1 parent ae7f340 commit 0033041

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ impl<'a> VisitMut<'a, bool> for AspectRatioMini {
9494
}
9595

9696
fn process_ration_value<'a>(decl: &'a Cow<'a, str>) -> String {
97-
let re = Regex::new(r#"['"]?(?:((?:\d*\.?\d*)?)(?:\s*[:|/]\s*)(\d*\.?\d*))['"]?"#).unwrap();
97+
let re = Regex::new(r#"['"]?(?:((?:\d*\.?\d*)?)(?:\s*[/]\s*)(\d*\.?\d*))['"]?"#).unwrap();
9898
re.replace_all(&decl, |caps: &Captures| {
9999
let computed_result = caps[2]
100100
.parse::<f32>()

tests/fixtures/damo.expected.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
position: relative;
33
}
44
[aspectratio][aspect-ratio="16:9"]:before {
5-
padding-top: 56.25%;
5+
padding-top: '16:9';
66
}
77
[aspectratio][aspect-ratio="16/9"]:before {
88
padding-top: 56.25%;

tests/fixtures/default.expected.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
padding-top: 56.25%;
66
}
77
.aspect-box:before {
8-
padding-top: 56.25%;
8+
padding-top: '16 : 9';
99
}
1010
.aspect-box:before {
11-
padding-top: 56.25%;
11+
padding-top: '16 | 9';
1212
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.aspect-box:before {
2-
padding-top: 56.25%;
2+
padding-top: "16:9";
33
}

0 commit comments

Comments
 (0)