Skip to content

Commit

Permalink
Update tests for interleaved declarations (#2002)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Jul 9, 2024
1 parent 81545a9 commit f3d9fc8
Show file tree
Hide file tree
Showing 29 changed files with 20,557 additions and 2 deletions.
51 changes: 51 additions & 0 deletions spec/css/font-face.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ a b c {
e: f;
}

<===> bubble/deeply-nested/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

,
1 | a { b { c { @font-face { e: f } g: h; } } }
| ^^^^ declaration
| =================== nested rule
'
input.scss 1:33 root stylesheet

<===>
================================================================================
<===> bubble/loaded/import/input.scss
Expand All @@ -73,6 +88,24 @@ c {
a: b;
}

<===> bubble/loaded/import/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

,--> input.scss
3 | d: e;
| ^^^^ declaration
'
,--> upstream.scss
1 | @font-face { a: b }
| =================== nested rule
'
input.scss 3:3 root stylesheet

<===>
================================================================================
<===> bubble/loaded/meta-load-css/input.scss
Expand All @@ -93,3 +126,21 @@ c {
@font-face {
a: b;
}

<===> bubble/loaded/meta-load-css/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

,--> input.scss
5 | d: e;
| ^^^^ declaration
'
,--> upstream.scss
1 | @font-face { a: b }
| =================== nested rule
'
input.scss 5:3 root stylesheet
136 changes: 136 additions & 0 deletions spec/css/style_rule.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,142 @@ a {
b: c;
}

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

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

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

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

<===> declaration/interleaved/after_nested_rule/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/around_nested_rule/input.scss
a {
b: c;
d {e: f}
g: h;
}

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

<===> declaration/interleaved/around_nested_rule/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

,
3 | d {e: f}
| ======== nested rule
4 | g: h;
| ^^^^ declaration
'
input.scss 4: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_at_rule/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

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

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

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

<===>
================================================================================
<===> declaration/comment/before_colon/loud/input.scss
Expand Down
19 changes: 19 additions & 0 deletions spec/libsass-closed-issues/issue_1081.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,22 @@ 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 f3d9fc8

Please sign in to comment.