Issue #1826 - Add typed calc() arithmetic for media queries

This commit is contained in:
Basilisk-Dev 2026-05-06 07:58:56 -04:00 • committed by EAZYBLACK
commit 79800a9113
4 changed files with 134 additions and 17 deletions

View file

@ -321,6 +321,21 @@ function run() {
(Math.floor(value/em_size) - 1) + "rem)");
}
change_state(function() {
iframe_style.width = "100px";
iframe_style.height = "10px";
});
should_apply("all and (width: calc(100px / 1em * 1em))");
should_apply("all and (width: calc((50vh * 5em) / 4px))");
should_apply("all and (width: calc(10vw / 10px * 1000vh))");
should_apply("all and (width: calc(8000vh * 1vw / 1em * 8px / 40vh))");
should_not_apply("all and (width: calc(100px / 1em * 2em))");
change_state(function() {
iframe_style.width = width_val + "px";
iframe_style.height = height_val + "px";
});
change_state(function() {
iframe_style.width = "0";
});