Skip to content

Commit

Permalink
Pull @font-face out to root (#1899)
Browse files Browse the repository at this point in the history
  • Loading branch information
Goodwine authored Mar 2, 2023
1 parent 664a670 commit eb1ced1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 1.58.4

* Pull `@font-face` to the root rather than bubbling the style rule selector
inwards.

### Embedded Sass

* Improve the performance of starting up a compilation.
Expand Down
4 changes: 3 additions & 1 deletion lib/src/visitor/async_evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,9 @@ class _EvaluateVisitor
await _withParent(ModifiableCssAtRule(name, node.span, value: value),
() async {
var styleRule = _styleRule;
if (styleRule == null || _inKeyframes) {
if (styleRule == null || _inKeyframes || name.value == 'font-face') {
// Special-cased at-rules within style blocks are pulled out to the
// root. Equivalent to prepending "@at-root" on them.
for (var child in children) {
await child.accept(this);
}
Expand Down
6 changes: 4 additions & 2 deletions lib/src/visitor/evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_evaluate.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: d84fe267879d0fb034853a0a8a5105b2919916ec
// Checksum: 73b7fb0f310d090dee2b3383f7b08c095e5fb1c0
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -1293,7 +1293,9 @@ class _EvaluateVisitor

_withParent(ModifiableCssAtRule(name, node.span, value: value), () {
var styleRule = _styleRule;
if (styleRule == null || _inKeyframes) {
if (styleRule == null || _inKeyframes || name.value == 'font-face') {
// Special-cased at-rules within style blocks are pulled out to the
// root. Equivalent to prepending "@at-root" on them.
for (var child in children) {
child.accept(this);
}
Expand Down

0 comments on commit eb1ced1

Please # to comment.