diff --git a/src/args.rs b/src/args.rs index 41e519b..ef010a4 100644 --- a/src/args.rs +++ b/src/args.rs @@ -172,7 +172,7 @@ pub(crate) fn eat_call_args>( match tok.kind { ')' => { args.insert( - name, + name.replace('_', "-"), Value::from_tokens(&mut val.into_iter().peekable(), scope, super_selector)?, ); return Ok(CallArgs(args)); @@ -191,7 +191,7 @@ pub(crate) fn eat_call_args>( } args.insert( - name, + name.replace('_', "-"), Value::from_tokens( &mut val.clone().into_iter().peekable(), scope, diff --git a/tests/mixins.rs b/tests/mixins.rs index acd9ca2..6c3865d 100644 --- a/tests/mixins.rs +++ b/tests/mixins.rs @@ -189,3 +189,8 @@ test!( "@mixin foo {\n color: red\n}\n\na {\n @include foo;\n}\n", "a {\n color: red;\n}\n" ); +test!( + args_interchangable_hypen_underscore, + "@mixin foo($a-b) {\n color: $a-b;\n color: $a_b;\n}\na {\n @include foo($a_b: a);\n @include foo($a-b: a);\n}\n", + "a {\n color: a;\n color: a;\n color: a;\n color: a;\n}\n" +);