Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests for interleaved declarations #2002

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading