aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2025-01-15 23:43:45 +0100
committerbptato <nincsnevem662@gmail.com>2025-01-16 01:58:42 +0100
commite76118ea080646cff4ed3017a9423ca299806e05 (patch)
treece1edad9782ff2d9b235add33e6e53ce175f87dc /test
parent5209268ce43e78dabdddeec761f431fb0f23fe5b (diff)
downloadchawan-e76118ea080646cff4ed3017a9423ca299806e05.tar.gz
cascade: basic CSS variable support
and once again, there was light... Well, it barely works, but it's enough to get colors back on most sites. Nested variables aren't supported for now, and shorthand expansion only "works" for `background' (it's a hack). Props to the W3C for introducing the C preprocessor to CSS - I was starting to confuse it with JSSS after calc().
Diffstat (limited to 'test')
-rw-r--r--test/layout/variables.color.expected2
-rw-r--r--test/layout/variables.html7
2 files changed, 9 insertions, 0 deletions
diff --git a/test/layout/variables.color.expected b/test/layout/variables.color.expected
new file mode 100644
index 00000000..59986144
--- /dev/null
+++ b/test/layout/variables.color.expected
@@ -0,0 +1,2 @@
+purple 
+
diff --git a/test/layout/variables.html b/test/layout/variables.html
new file mode 100644
index 00000000..cd6d3696
--- /dev/null
+++ b/test/layout/variables.html
@@ -0,0 +1,7 @@
+<style>
+a { --purple: purple; color: var(--purple) }
+div { color: white; --pink: yellow !important; background-color: var(--purple) }
+</style>
+<a>
+<div>purple</div>
+</a>