Skip to content

Commit 660ec30

Browse files
committed
Support all length units in css-values-4
Closes parcel-bundler#119. Closes parcel-bundler#116.
1 parent 2b2c6ef commit 660ec30

File tree

4 files changed

+202
-193
lines changed

4 files changed

+202
-193
lines changed

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ parcel_sourcemap = "2.0.2"
3535
data-encoding = "2.3.2"
3636
lazy_static = "1.4.0"
3737
retain_mut = "0.1.5"
38+
const-str = "0.3.1"
3839
# CLI deps
3940
clap = { version = "3.0.6", features = ["derive"], optional = true }
4041
serde_json = { version = "1.0.78", optional = true }

src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,6 +4116,18 @@ mod tests {
41164116
..Browsers::default()
41174117
}
41184118
);
4119+
4120+
minify_test(".foo { width: calc(1vh + 2vh) }", ".foo{width:3vh}");
4121+
minify_test(".foo { width: calc(1dvh + 2dvh) }", ".foo{width:3dvh}");
4122+
minify_test(".foo { width: calc(1lvh + 2lvh) }", ".foo{width:3lvh}");
4123+
minify_test(".foo { width: calc(1svh + 2svh) }", ".foo{width:3svh}");
4124+
minify_test(".foo { width: calc(1sVmin + 2Svmin) }", ".foo{width:3svmin}");
4125+
minify_test(".foo { width: calc(1ic + 2ic) }", ".foo{width:3ic}");
4126+
minify_test(".foo { width: calc(1ric + 2ric) }", ".foo{width:3ric}");
4127+
minify_test(".foo { width: calc(1cap + 2cap) }", ".foo{width:3cap}");
4128+
minify_test(".foo { width: calc(1lh + 2lh) }", ".foo{width:3lh}");
4129+
minify_test(".foo { width: calc(1x + 2x) }", ".foo{width:calc(1x + 2x)}");
4130+
41194131
}
41204132

41214133
#[test]

0 commit comments

Comments
 (0)