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 1 commit
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
45 changes: 45 additions & 0 deletions spec/css/font-face.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ 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 `@nest {}`.

,
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 +86,22 @@ 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 `@nest {}`.

,--> 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 +122,19 @@ 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 `@nest {}`.

,--> input.scss
5 | d: e;
| ^^^^ declaration
'
,--> upstream.scss
1 | @font-face { a: b }
| =================== nested rule
'
input.scss 5:3 root stylesheet
122 changes: 122 additions & 0 deletions spec/css/nest.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
<===> in_style_rule/before_nested_rule/input.scss
a {
@nest {b: c}
d {e: f}
}

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

<===>
================================================================================
<===> in_style_rule/after_nested_rule/input.scss
a {
b {c: d}
@nest {e: f}
}

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

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

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

<===>
================================================================================
<===> no_style_rule/top_level/input.scss
@nest {a: b}

<===> no_style_rule/top_level/output.css
@nest {
a: b;
}

<===>
================================================================================
<===> no_style_rule/in_at_rule/input.scss
@a {@nest {b: c}}

<===> no_style_rule/in_at_rule/output.css
@a {
@nest {
b: c;
}
}

<===>
================================================================================
<===> case_insensitive/input.scss
a {
@NeSt {b: c}
}

<===> case_insensitive/output.css
a {
b: c;
}

<===>
================================================================================
<===> error/args/input.scss
@nest a {}

<===> error/args/error
Error: expected "{".
,
1 | @nest a {}
| ^
'
input.scss 1:7 root stylesheet

<===>
================================================================================
<===> error/in_keyframes/top/input.scss
@keyframes a {@nest {}}

<===> error/in_keyframes/top/error
Error: @nest may not be used within a keyframe block.
,
1 | @keyframes a {@nest {}}
| ^^^^^^^^
'
input.scss 1:15 root stylesheet

<===>
================================================================================
<===> error/in_keyframes/in_keyframe/input.scss
@keyframes a {
0% {@nest {}}
}

<===> error/in_keyframes/in_keyframe/error
Error: @nest may not be used within a keyframe block.
,
2 | 0% {@nest {}}
| ^^^^^^^^
'
input.scss 2:7 root stylesheet
101 changes: 101 additions & 0 deletions spec/css/plain/nest.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<===> in_style_rule/before_nested_rule/input.scss
@use 'plain';

<===> in_style_rule/before_nested_rule/plain.css
a {
@nest {b: c}
d {e: f}
}

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

<===>
================================================================================
<===> in_style_rule/after_nested_rule/input.scss
@use 'plain';

<===> in_style_rule/after_nested_rule/plain.css
a {
b {c: d}
@nest {e: f}
}

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

<===>
================================================================================
<===> in_style_rule/in_bubbled_rule/input.scss
@use 'plain';

<===> in_style_rule/in_bubbled_rule/plain.css
a {
b {c: d}
@e {@nest {f: g}}
}

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

<===>
================================================================================
<===> no_style_rule/top_level/input.scss
@use 'plain';

<===> no_style_rule/top_level/plain.css
@nest {a: b}

<===> no_style_rule/top_level/output.css
@nest {
a: b;
}

<===>
================================================================================
<===> no_style_rule/in_at_rule/input.scss
@use 'plain';

<===> no_style_rule/in_at_rule/plain.css
@a {@nest {b: c}}

<===> no_style_rule/in_at_rule/output.css
@a {
@nest {
b: c;
}
}

<===>
================================================================================
<===> case_insensitive/input.scss
@use 'plain';

<===> case_insensitive/plain.css
a {
@NeSt {b: c}
}

<===> case_insensitive/output.css
a {
b: c;
}
Loading
Loading