Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull @font-face out to root #1899

Merged
merged 2 commits into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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