From 79faefd2413500dc2285b3b7e2dd39bf2691fec7 Mon Sep 17 00:00:00 2001 From: Koen Lagveen Date: Sat, 17 Feb 2024 22:28:33 +0100 Subject: [PATCH] add (naive) tests for at-root --- Tests/syntax_test_scss.scss | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/Tests/syntax_test_scss.scss b/Tests/syntax_test_scss.scss index 0522a0fa..1125383c 100644 --- a/Tests/syntax_test_scss.scss +++ b/Tests/syntax_test_scss.scss @@ -1042,3 +1042,37 @@ $accent: #e1d7d2; margin-left: $divider-offset; width: calc(100% - #{$divider-offset}); } + +//============================================================================= +// At-root +// https://sass-lang.com/documentation/at-rules/at-root/ +//============================================================================= +@mixin unify-parent($child) { + @at-root #{selector.unify(&, $child)} { +//^^^^^^^^ keyword.control.directive.at-root.scss +//^ punctuation.definition.keyword.scss +// ^^ meta.interpolation + @content; +// ^^^^^^^^ keyword.control.directive.content.scss +// ^ punctuation.definition.keyword.scss + } +} + +// https://sass-lang.com/documentation/at-rules/at-root/#beyond-style-rules +@media print { + .page { + width: 8in; + + @at-root (without: media) { +// ^^^^^^^^ keyword.control.directive.at-root.scss +// ^ punctuation.definition.keyword.scss +// ^ punctuation.separator.key-value.css + + color: #111; + } + + @at-root (with: rule) { + font-size: 1.2em; + } + } +}