Skip to content

Commit

Permalink
Update mixed-decl tests to reflect the improved implementation (#2014)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Sep 13, 2024
1 parent e83abf6 commit 5d57580
Show file tree
Hide file tree
Showing 25 changed files with 172 additions and 20,253 deletions.
228 changes: 172 additions & 56 deletions spec/css/style_rule.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,71 @@ a {

<===>
================================================================================
<===> declaration/interleaved/before_nested_rule/input.scss
a {
<===> declaration/interleaved/before_style_rule/input.scss
.a {
b: c;
d {e: f}
.d {e: f}
}

<===> declaration/interleaved/before_nested_rule/output.css
a {
<===> declaration/interleaved/before_style_rule/output.css
.a {
b: c;
}
a d {
.a .d {
e: f;
}

<===>
================================================================================
<===> declaration/interleaved/after_nested_rule/input.scss
a {
b {c: d}
e: f
<===> declaration/interleaved/around_style_rule/input.scss
.a {
b: c;
.d {e: f}
g: h;
}

<===> declaration/interleaved/after_nested_rule/output.css
a {
<===> declaration/interleaved/around_style_rule/output.css
.a {
b: c;
g: h;
}
.a .d {
e: f;
}
a b {

<===>
================================================================================
<===> declaration/interleaved/after_style_rule/higher_specificity/input.scss
.a {
.b {c: d}
e: f;
}

<===> declaration/interleaved/after_style_rule/higher_specificity/output.css
.a {
e: f;
}
.a .b {
c: d;
}

<===>
================================================================================
<===> declaration/interleaved/after_style_rule/same_specificity/input.scss
.a {
:where(.b) {c: d}
e: f;
}

<===> declaration/interleaved/after_style_rule/same_specificity/output.css
.a {
e: f;
}
.a :where(.b) {
c: d;
}

<===> declaration/interleaved/after_nested_rule/warning
<===> declaration/interleaved/after_style_rule/same_specificity/warning
DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
Expand All @@ -58,32 +92,62 @@ rule. To opt into the new behavior, wrap the declaration in `& {}`.
More info: https://sass-lang.com/d/mixed-decls

,
2 | b {c: d}
| ======== nested rule
3 | e: f
2 | :where(.b) {c: d}
| ================= nested rule
3 | e: f;
| ^^^^ declaration
'
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> declaration/interleaved/around_nested_rule/input.scss
a {
b: c;
d {e: f}
g: h;
<===> declaration/interleaved/after_style_rule/mixed_specificity_parent/input.scss
.a, :where(.a) {
.b {c: d}
e: f;
}

<===> declaration/interleaved/around_nested_rule/output.css
a {
b: c;
g: h;
<===> declaration/interleaved/after_style_rule/mixed_specificity_parent/output.css
.a, :where(.a) {
e: f;
}
.a .b, :where(.a) .b {
c: d;
}
a d {

<===> declaration/interleaved/after_style_rule/mixed_specificity_parent/warning
DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

,
2 | .b {c: d}
| ========= nested rule
3 | e: f;
| ^^^^ declaration
'
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> declaration/interleaved/after_style_rule/mixed_specificity_child/input.scss
.a {
.b, :where(.b) {c: d}
e: f;
}

<===> declaration/interleaved/around_nested_rule/warning
<===> declaration/interleaved/after_style_rule/mixed_specificity_child/output.css
.a {
e: f;
}
.a .b, .a :where(.b) {
c: d;
}

<===> declaration/interleaved/after_style_rule/mixed_specificity_child/warning
DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
Expand All @@ -92,34 +156,32 @@ rule. To opt into the new behavior, wrap the declaration in `& {}`.
More info: https://sass-lang.com/d/mixed-decls

,
3 | d {e: f}
| ======== nested rule
4 | g: h;
2 | .b, :where(.b) {c: d}
| ===================== nested rule
3 | e: f;
| ^^^^ declaration
'
input.scss 4:3 root stylesheet
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> declaration/interleaved/in_at_rule/input.scss
@a {
b {
c {d: e}
f: g;
}
<===> declaration/interleaved/after_style_rule/extended_parent/input.scss
.a {
.b {c: d}
e: f;
}

<===> declaration/interleaved/in_at_rule/output.css
@a {
b {
f: g;
}
b c {
d: e;
}
:where(.g) {@extend .a}

<===> declaration/interleaved/after_style_rule/extended_parent/output.css
.a, :where(.g) {
e: f;
}
.a .b, :where(.g) .b {
c: d;
}

<===> declaration/interleaved/in_at_rule/warning
<===> declaration/interleaved/after_style_rule/extended_parent/warning
DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
Expand All @@ -128,27 +190,81 @@ rule. To opt into the new behavior, wrap the declaration in `& {}`.
More info: https://sass-lang.com/d/mixed-decls

,
3 | c {d: e}
| ======== nested rule
4 | f: g;
| ^^^^ declaration
2 | .b {c: d}
| ========= nested rule
3 | e: f;
| ^^^^ declaration
'
input.scss 4:5 root stylesheet
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> declaration/interleaved/after_style_rule/extended_child/input.scss
.a {
.b {c: d}
e: f;
}

:where(.g) {@extend .b}

<===> declaration/interleaved/after_style_rule/extended_child/output.css
.a {
e: f;
}
.a .b, .a :where(.g) {
c: d;
}

<===> declaration/interleaved/after_style_rule/extended_child/warning
DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

,
2 | .b {c: d}
| ========= nested rule
3 | e: f;
| ^^^^ declaration
'
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> declaration/interleaved/in_at_rule/input.scss
@a {
.b {
.c {d: e}
f: g;
}
}

<===> declaration/interleaved/in_at_rule/output.css
@a {
.b {
f: g;
}
.b .c {
d: e;
}
}

<===>
================================================================================
<===> declaration/interleaved/in_bubbled_rule/input.scss
a {
b {c: d}
.a {
.b {c: d}
@e {f: g}
}

<===> declaration/interleaved/in_bubbled_rule/output.css
a b {
.a .b {
c: d;
}
@e {
a {
.a {
f: g;
}
}
Expand Down
19 changes: 0 additions & 19 deletions spec/libsass-closed-issues/issue_1081.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,3 @@ unnecessary and can safely be removed.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
'
input.scss 1:1 root stylesheet

DEPRECATION WARNING: Sass's behavior for declarations that appear after nested
rules will be changing to match the behavior specified by CSS in an upcoming
version. To keep the existing behavior, move the declaration above the nested
rule. To opt into the new behavior, wrap the declaration in `& {}`.

More info: https://sass-lang.com/d/mixed-decls

,--> input.scss
11| foo: $foo;
| ^^^^^^^^^ declaration
'
,--> _import.scss
7 | / import-after {
8 | | foo: $foo;
9 | | }
| '--- nested rule
'
input.scss 11:3 root stylesheet
Loading

0 comments on commit 5d57580

Please sign in to comment.