From feb75800c801011ee7850cfe32b487fb2c41fa54 Mon Sep 17 00:00:00 2001 From: Connor Skees Date: Fri, 21 Aug 2020 19:27:44 -0400 Subject: [PATCH] allow whitespace between `@content` and its args --- src/parse/mixin.rs | 2 ++ tests/mixins.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/parse/mixin.rs b/src/parse/mixin.rs index 9c8d016..56370e7 100644 --- a/src/parse/mixin.rs +++ b/src/parse/mixin.rs @@ -213,6 +213,8 @@ impl<'a> Parser<'a> { let mut entered_scope = false; + self.whitespace_or_comment(); + let call_args = if self.consume_char_if_exists('(') { self.parse_call_args()? } else { diff --git a/tests/mixins.rs b/tests/mixins.rs index 85697df..a148948 100644 --- a/tests/mixins.rs +++ b/tests/mixins.rs @@ -538,6 +538,20 @@ test!( }", "a {\n color: red;\n}\n" ); +test!( + space_between_content_and_args, + "space-after-content { + @mixin mixin { + @content /**/ (value1, value2); + } + + @include mixin using ($arg1, $arg2) { + arg1: $arg1; + arg2: $arg2; + } + }", + "space-after-content {\n arg1: value1;\n arg2: value2;\n}\n" +); error!( mixin_in_function, "@function foo() {