Skip to content

Commit

Permalink
[scss] error when function/include inside @Keyframes (#372)
Browse files Browse the repository at this point in the history
* [scss] error when @function inside @Keyframes

* support include in keyframes
  • Loading branch information
aeschli authored Nov 14, 2023
1 parent 5d30238 commit 9734506
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/parser/scssParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ export class SCSSParser extends cssParser.Parser {
public _parseKeyframeSelector(): nodes.Node | null {
return this._tryParseKeyframeSelector()
|| this._parseControlStatement(this._parseKeyframeSelector.bind(this))
|| this._parseWarnAndDebug() // @warn, @debug and @error statements
|| this._parseMixinReference() // @include
|| this._parseFunctionDeclaration() // @function
|| this._parseVariableDeclaration()
|| this._parseMixinContent();
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/scss/parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ suite('SCSS - Parser', () => {
assertNode('@keyframes test-keyframe { @for $i from 1 through 60 { $s: ($i * 100) / 60 + "%"; } }', parser, parser._parseKeyframe.bind(parser));

assertNode('@keyframes name { @for $i from 0 through m.$steps { #{$i * (100%/$steps)} { transform: $rotate $translate; } } }', parser, parser._parseKeyframe.bind(parser));
assertNode('@keyframes name { @function bar() { } }', parser, parser._parseKeyframe.bind(parser)); // #197742
assertNode('@keyframes name { @include keyframe-mixin(); }', parser, parser._parseKeyframe.bind(parser)); // #197742
});

test('@extend', function () {
Expand Down

0 comments on commit 9734506

Please sign in to comment.