Skip to content

Commit

Permalink
add (naive) tests for at-root
Browse files Browse the repository at this point in the history
  • Loading branch information
braver committed Feb 17, 2024
1 parent 21cb964 commit 79faefd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Tests/syntax_test_scss.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

0 comments on commit 79faefd

Please sign in to comment.