diff --git a/CHANGELOG.md b/CHANGELOG.md index 11998e4ee..81814ec23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 7eb5f4f7f..38c1c1b23 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -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); } diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index 45d5986aa..d9e6dbf21 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -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 @@ -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); }