From 85f39d5ad7056e0afeab4ad649fc34eaed8c89a5 Mon Sep 17 00:00:00 2001 From: Natalie Weizenbaum Date: Mon, 6 May 2024 14:48:24 -0700 Subject: [PATCH] Allow at-rules in `@keyframes` blocks (#2236) See sass/sass#3859 See sass/sass#3861 See sass/sass-spec#1987 --- CHANGELOG.md | 4 ++++ lib/src/visitor/async_evaluate.dart | 15 --------------- lib/src/visitor/evaluate.dart | 17 +---------------- pkg/sass_api/CHANGELOG.md | 4 ++++ pkg/sass_api/pubspec.yaml | 4 ++-- pubspec.yaml | 2 +- 6 files changed, 12 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adfce2e9b..52adaf61a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 8343a9131..b564b8323 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -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); @@ -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); @@ -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( @@ -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) { @@ -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( diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index bbf334ad1..473728c1c 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: 135bf44f65efcbebb4a55b38ada86c754fcdb86b +// Checksum: 7788c21fd8c721992490ac01d0ef4783dddf3f1f // // ignore_for_file: unused_import @@ -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); @@ -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); @@ -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 = @@ -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) { @@ -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( diff --git a/pkg/sass_api/CHANGELOG.md b/pkg/sass_api/CHANGELOG.md index d72b35469..1c068a43f 100644 --- a/pkg/sass_api/CHANGELOG.md +++ b/pkg/sass_api/CHANGELOG.md @@ -1,3 +1,7 @@ +## 10.4.0 + +* No user-visible changes. + ## 10.3.0 * No user-visible changes. diff --git a/pkg/sass_api/pubspec.yaml b/pkg/sass_api/pubspec.yaml index 3d8c3388a..aa5fda388 100644 --- a/pkg/sass_api/pubspec.yaml +++ b/pkg/sass_api/pubspec.yaml @@ -2,7 +2,7 @@ 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 @@ -10,7 +10,7 @@ environment: sdk: ">=3.0.0 <4.0.0" dependencies: - sass: 1.76.0 + sass: 1.77.0 dev_dependencies: dartdoc: ^6.0.0 diff --git a/pubspec.yaml b/pubspec.yaml index e78af1daa..8bc82a811 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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