Skip to content

Commit 7bb7701

Browse files
committed
Add test for :root unification in 3.5
1 parent 81bc577 commit 7bb7701

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:root .foo-1, :root .bar-1 .baz-1 { test: 1; }
2+
3+
.foo-2:root .bar-2, .baz-2.foo-2:root .bang-2 { test: 2; }
4+
5+
html:root .bar-3 { test: 3; }
6+
7+
.foo-4:root > .bar-4 .x-4, .baz-4.foo-4:root > .bar-4 .bang-4 .y-4 { test: 4; }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// We assume that by default classes don't apply to the :root unless marked explicitly.
2+
:root .foo-1 { test: 1; }
3+
.bar-1 .baz-1 { @extend .foo-1; }
4+
5+
// We know the two classes must be the same :root element so we can combine them.
6+
.foo-2:root .bar-2 { test: 2; }
7+
.baz-2:root .bang-2 { @extend .bar-2; }
8+
9+
// This extend should not apply because the :root elements are different.
10+
html:root .bar-3 { test: 3; }
11+
xml:root .bang-3 { @extend .bar-3}
12+
13+
// We assume that direct descendant of the :root is not the same element as a descendant.
14+
.foo-4:root > .bar-4 .x-4 { test: 4; }
15+
.baz-4:root .bang-4 .y-4 {@extend .x-4}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
:output_style: :compact

spec/sass_3_5/options.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
:start_version: '3.5'

0 commit comments

Comments
 (0)