Skip to content

Commit

Permalink
Allow at-rules in @keyframes blocks (#2236)
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 authored May 6, 2024
1 parent 264b2d5 commit 85f39d5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 34 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.77.0

* *Don't* throw errors for at-rules in keyframe blocks.

## 1.76.0

* Throw errors for misplaced statements in keyframe blocks.
Expand Down
15 changes: 0 additions & 15 deletions lib/src/visitor/async_evaluate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1324,9 +1324,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"At-rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var name = await _interpolationToValue(node.name);
Expand Down Expand Up @@ -1898,9 +1895,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"Media rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var queries = await _visitMediaQueries(node.query);
Expand Down Expand Up @@ -2121,9 +2115,6 @@ final class _EvaluateVisitor
throw _exception(
"Supports rules may not be used within nested declarations.",
node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var condition = CssValue(
Expand Down Expand Up @@ -3282,9 +3273,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"At-rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

if (node.isChildless) {
Expand Down Expand Up @@ -3368,9 +3356,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"Media rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var mergedQueries = _mediaQueries.andThen(
Expand Down
17 changes: 1 addition & 16 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: 135bf44f65efcbebb4a55b38ada86c754fcdb86b
// Checksum: 7788c21fd8c721992490ac01d0ef4783dddf3f1f
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -1321,9 +1321,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"At-rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var name = _interpolationToValue(node.name);
Expand Down Expand Up @@ -1890,9 +1887,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"Media rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var queries = _visitMediaQueries(node.query);
Expand Down Expand Up @@ -2111,9 +2105,6 @@ final class _EvaluateVisitor
throw _exception(
"Supports rules may not be used within nested declarations.",
node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var condition =
Expand Down Expand Up @@ -3252,9 +3243,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"At-rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

if (node.isChildless) {
Expand Down Expand Up @@ -3338,9 +3326,6 @@ final class _EvaluateVisitor
if (_declarationName != null) {
throw _exception(
"Media rules may not be used within nested declarations.", node.span);
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
throw _exception(
"At-rules may not be used within keyframe blocks.", node.span);
}

var mergedQueries = _mediaQueries.andThen(
Expand Down
4 changes: 4 additions & 0 deletions pkg/sass_api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 10.4.0

* No user-visible changes.

## 10.3.0

* No user-visible changes.
Expand Down
4 changes: 2 additions & 2 deletions pkg/sass_api/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: sass_api
# Note: Every time we add a new Sass AST node, we need to bump the *major*
# version because it's a breaking change for anyone who's implementing the
# visitor interface(s).
version: 10.3.0
version: 10.4.0
description: Additional APIs for Dart Sass.
homepage: https://github.com/sass/dart-sass

environment:
sdk: ">=3.0.0 <4.0.0"

dependencies:
sass: 1.76.0
sass: 1.77.0

dev_dependencies:
dartdoc: ^6.0.0
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.76.0
version: 1.77.0
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit 85f39d5

Please sign in to comment.