Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for underscores where hyphens aren't allowed #1994

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions spec/directives/function.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,65 @@ For details, see https://sass-lang.com/d/css-function-mixin
1 | @function --a() {@return 1}
| ^^^
'

<===>
================================================================================
<===> double_underscore_name/input.scss
@function __a() {@return 1}
b {c: __a()}

<===> double_underscore_name/output.css
b {
c: 1;
}

<===>
================================================================================
<===> custom_ident_call/input.scss
@function __a() {@return 1}
b {c: --a()}

<===> custom_ident_call/output.css
b {
c: 1;
}

<===> custom_ident_call/warning
DEPRECATION WARNING: Sass @function names beginning with -- are deprecated for forward-compatibility with plain CSS functions.

For details, see https://sass-lang.com/d/css-function-mixin

,
2 | b {c: --a()}
| ^^^
'
input.scss 2:7 root stylesheet

<===>
================================================================================
<===> vendor_like_underscore/README.md
Function names like `-moz-calc()` aren't allowed, but they are with underscores.

<===>
================================================================================
<===> vendor_like_underscore/start/input.scss
@function _moz-calc() {@return 1}
b {c: _moz-calc()}

<===> vendor_like_underscore/start/output.css
b {
c: 1;
}

<===>
================================================================================
<===> vendor_like_underscore/middle/input.scss
@function -moz_calc() {@return 1}
b {c: -moz_calc()}

<===> vendor_like_underscore/middle/output.css
b {
c: 1;
}


33 changes: 33 additions & 0 deletions spec/directives/mixin.hrx
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,36 @@ For details, see https://sass-lang.com/d/css-function-mixin
1 | @mixin --a {b: c}
| ^^^
'

<===>
================================================================================
<===> double_underscore_name/input.scss
@mixin __a() {b: c}
d {@include __a}

<===> double_underscore_name/output.css
d {
b: c;
}

<===>
================================================================================
<===> custom_ident_include/input.scss
@mixin __a() {b: c}
d {@include --a}

<===> custom_ident_include/output.css
d {
b: c;
}

<===> custom_ident_include/warning
DEPRECATION WARNING: Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins.

For details, see https://sass-lang.com/d/css-function-mixin

,
2 | d {@include --a}
| ^^^
'
input.scss 2:13 root stylesheet
Loading