Skip to content

Commit

Permalink
Add specs for :has(+ &) (#1900)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored Apr 19, 2023
1 parent 752860e commit 50bfcfa
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 51 deletions.
99 changes: 48 additions & 51 deletions spec/css/selector/combinator/has.hrx
Original file line number Diff line number Diff line change
@@ -1,89 +1,86 @@
<===> leading/single/child/options.yml
:ignore_for:
- libsass

<===> leading/single/child/input.scss
:is(> a) {b: c}
:has(> a) {b: c}

<===> leading/single/child/output.css

<===> leading/single/child/warning
DEPRECATION WARNING: The selector ":is(> a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(> a) {b: c}
| ^^^^^^^^
'
input.scss 1:1 root stylesheet
:has(> a) {
b: c;
}

<===>
================================================================================
<===> leading/single/next_sibling/options.yml
:ignore_for:
- libsass

<===> leading/single/next_sibling/input.scss
:is(+ a) {b: c}
:has(+ a) {b: c}

<===> leading/single/next_sibling/output.css
:has(+ a) {
b: c;
}

<===> leading/single/next_sibling/warning
DEPRECATION WARNING: The selector ":is(+ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.
<===>
================================================================================
<===> leading/single/sibling/input.scss
:has(~ a) {b: c}

More info: https://sass-lang.com/d/bogus-combinators
<===> leading/single/sibling/output.css
:has(~ a) {
b: c;
}

,
1 | :is(+ a) {b: c}
| ^^^^^^^^
'
input.scss 1:1 root stylesheet
<===>
================================================================================
<===> leading/single/parent/input.scss
// Regression test for sass/sass#3546
a {
:has(~ &) {b: c}
}

<===> leading/single/parent/output.css
:has(~ a) {
b: c;
}

<===>
================================================================================
<===> leading/single/sibling/options.yml
<===> leading/multiple/options.yml
:ignore_for:
- libsass

<===> leading/single/sibling/input.scss
:is(~ a) {b: c}
<===>
================================================================================
<===> leading/multiple/direct/input.scss
:has(+ ~ a) {b: c}

<===> leading/single/sibling/output.css
<===> leading/multiple/direct/output.css

<===> leading/single/sibling/warning
DEPRECATION WARNING: The selector ":is(~ a)" is invalid CSS. It will be omitted from the generated CSS.
<===> leading/multiple/direct/warning
DEPRECATION WARNING: The selector ":has(+ ~ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(~ a) {b: c}
| ^^^^^^^^
1 | :has(+ ~ a) {b: c}
| ^^^^^^^^^^^
'
input.scss 1:1 root stylesheet

<===>
================================================================================
<===> leading/multiple/options.yml
:ignore_for:
- libsass
<===> leading/multiple/parent/input.scss
~ a {
:has(+ &) {b: c}
}

<===> leading/multiple/input.scss
:is(+ ~ a) {b: c}
<===> leading/multiple/parent/output.css

<===> leading/multiple/output.css

<===> leading/multiple/warning
DEPRECATION WARNING: The selector ":is(+ ~ a)" is invalid CSS. It will be omitted from the generated CSS.
<===> leading/multiple/parent/warning
DEPRECATION WARNING: The selector ":has(+ ~ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(+ ~ a) {b: c}
| ^^^^^^^^^^
2 | :has(+ &) {b: c}
| ^^^^^^^^^
'
input.scss 1:1 root stylesheet
input.scss 2:3 root stylesheet
89 changes: 89 additions & 0 deletions spec/css/selector/combinator/is.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<===> leading/single/child/options.yml
:ignore_for:
- libsass

<===> leading/single/child/input.scss
:is(> a) {b: c}

<===> leading/single/child/output.css

<===> leading/single/child/warning
DEPRECATION WARNING: The selector ":is(> a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(> a) {b: c}
| ^^^^^^^^
'
input.scss 1:1 root stylesheet

<===>
================================================================================
<===> leading/single/next_sibling/options.yml
:ignore_for:
- libsass

<===> leading/single/next_sibling/input.scss
:is(+ a) {b: c}

<===> leading/single/next_sibling/output.css

<===> leading/single/next_sibling/warning
DEPRECATION WARNING: The selector ":is(+ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(+ a) {b: c}
| ^^^^^^^^
'
input.scss 1:1 root stylesheet

<===>
================================================================================
<===> leading/single/sibling/options.yml
:ignore_for:
- libsass

<===> leading/single/sibling/input.scss
:is(~ a) {b: c}

<===> leading/single/sibling/output.css

<===> leading/single/sibling/warning
DEPRECATION WARNING: The selector ":is(~ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(~ a) {b: c}
| ^^^^^^^^
'
input.scss 1:1 root stylesheet

<===>
================================================================================
<===> leading/multiple/options.yml
:ignore_for:
- libsass

<===> leading/multiple/input.scss
:is(+ ~ a) {b: c}

<===> leading/multiple/output.css

<===> leading/multiple/warning
DEPRECATION WARNING: The selector ":is(+ ~ a)" is invalid CSS. It will be omitted from the generated CSS.
This will be an error in Dart Sass 2.0.0.

More info: https://sass-lang.com/d/bogus-combinators

,
1 | :is(+ ~ a) {b: c}
| ^^^^^^^^^^
'
input.scss 1:1 root stylesheet

0 comments on commit 50bfcfa

Please sign in to comment.