Skip to content

Commit 85f39d5

Browse files
authored
Allow at-rules in @keyframes blocks (#2236)
See sass/sass#3859 See sass/sass#3861 See sass/sass-spec#1987
1 parent 264b2d5 commit 85f39d5

File tree

6 files changed

+12
-34
lines changed

6 files changed

+12
-34
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.77.0
2+
3+
* *Don't* throw errors for at-rules in keyframe blocks.
4+
15
## 1.76.0
26

37
* Throw errors for misplaced statements in keyframe blocks.

lib/src/visitor/async_evaluate.dart

-15
Original file line numberDiff line numberDiff line change
@@ -1324,9 +1324,6 @@ final class _EvaluateVisitor
13241324
if (_declarationName != null) {
13251325
throw _exception(
13261326
"At-rules may not be used within nested declarations.", node.span);
1327-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
1328-
throw _exception(
1329-
"At-rules may not be used within keyframe blocks.", node.span);
13301327
}
13311328

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

19061900
var queries = await _visitMediaQueries(node.query);
@@ -2121,9 +2115,6 @@ final class _EvaluateVisitor
21212115
throw _exception(
21222116
"Supports rules may not be used within nested declarations.",
21232117
node.span);
2124-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
2125-
throw _exception(
2126-
"At-rules may not be used within keyframe blocks.", node.span);
21272118
}
21282119

21292120
var condition = CssValue(
@@ -3282,9 +3273,6 @@ final class _EvaluateVisitor
32823273
if (_declarationName != null) {
32833274
throw _exception(
32843275
"At-rules may not be used within nested declarations.", node.span);
3285-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
3286-
throw _exception(
3287-
"At-rules may not be used within keyframe blocks.", node.span);
32883276
}
32893277

32903278
if (node.isChildless) {
@@ -3368,9 +3356,6 @@ final class _EvaluateVisitor
33683356
if (_declarationName != null) {
33693357
throw _exception(
33703358
"Media rules may not be used within nested declarations.", node.span);
3371-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
3372-
throw _exception(
3373-
"At-rules may not be used within keyframe blocks.", node.span);
33743359
}
33753360

33763361
var mergedQueries = _mediaQueries.andThen(

lib/src/visitor/evaluate.dart

+1-16
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_evaluate.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 135bf44f65efcbebb4a55b38ada86c754fcdb86b
8+
// Checksum: 7788c21fd8c721992490ac01d0ef4783dddf3f1f
99
//
1010
// ignore_for_file: unused_import
1111

@@ -1321,9 +1321,6 @@ final class _EvaluateVisitor
13211321
if (_declarationName != null) {
13221322
throw _exception(
13231323
"At-rules may not be used within nested declarations.", node.span);
1324-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
1325-
throw _exception(
1326-
"At-rules may not be used within keyframe blocks.", node.span);
13271324
}
13281325

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

18981892
var queries = _visitMediaQueries(node.query);
@@ -2111,9 +2105,6 @@ final class _EvaluateVisitor
21112105
throw _exception(
21122106
"Supports rules may not be used within nested declarations.",
21132107
node.span);
2114-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
2115-
throw _exception(
2116-
"At-rules may not be used within keyframe blocks.", node.span);
21172108
}
21182109

21192110
var condition =
@@ -3252,9 +3243,6 @@ final class _EvaluateVisitor
32523243
if (_declarationName != null) {
32533244
throw _exception(
32543245
"At-rules may not be used within nested declarations.", node.span);
3255-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
3256-
throw _exception(
3257-
"At-rules may not be used within keyframe blocks.", node.span);
32583246
}
32593247

32603248
if (node.isChildless) {
@@ -3338,9 +3326,6 @@ final class _EvaluateVisitor
33383326
if (_declarationName != null) {
33393327
throw _exception(
33403328
"Media rules may not be used within nested declarations.", node.span);
3341-
} else if (_inKeyframes && _parent is CssKeyframeBlock) {
3342-
throw _exception(
3343-
"At-rules may not be used within keyframe blocks.", node.span);
33443329
}
33453330

33463331
var mergedQueries = _mediaQueries.andThen(

pkg/sass_api/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 10.4.0
2+
3+
* No user-visible changes.
4+
15
## 10.3.0
26

37
* No user-visible changes.

pkg/sass_api/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 10.3.0
5+
version: 10.4.0
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

99
environment:
1010
sdk: ">=3.0.0 <4.0.0"
1111

1212
dependencies:
13-
sass: 1.76.0
13+
sass: 1.77.0
1414

1515
dev_dependencies:
1616
dartdoc: ^6.0.0

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.76.0
2+
version: 1.77.0
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)