From f792b6f7f57dd0efaf6c85ab1c891c27a82cfe32 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 17 Apr 2023 12:20:26 -0700 Subject: [PATCH] Add specs for :has(+ &) See sass/dart-sass#1937 --- spec/css/selector/combinator/has.hrx | 99 ++++++++++++++-------------- 1 file changed, 48 insertions(+), 51 deletions(-) diff --git a/spec/css/selector/combinator/has.hrx b/spec/css/selector/combinator/has.hrx index 0bccac5ca..93ee2d4df 100644 --- a/spec/css/selector/combinator/has.hrx +++ b/spec/css/selector/combinator/has.hrx @@ -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