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 deprecation tests for custom-ident functions and mixins #1982

Merged
merged 1 commit into from
Apr 30, 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
1 change: 1 addition & 0 deletions js-api-spec/deprecations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const activeDeprecations: {[key in keyof Deprecations]?: string} = {
'null-alpha': '1.62.3',
'abs-percent': '1.65.0',
'fs-importer-cwd': '1.73.0',
'css-function-mixin': '1.76.0',
};

/**
Expand Down
32 changes: 32 additions & 0 deletions spec/directives/function.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<===> escaped/input.scss
// Function names can be defined and referred to using escapes, which are
// normalized.
@function f\6Fo-bar() {@return 1}

a {b: foo-b\61r()}

<===> escaped/output.css
a {
b: 1;
}

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

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

<===> custom_ident_name/warning
DEPRECATION WARNING on line 1, column 11 of input.scss:
Sass @function names beginning with -- are deprecated for forward-compatibility with plain CSS mixins.

For details, see https://sass-lang.com/d/css-function-mixin
,
1 | @function --a() {@return 1}
| ^^^
'
11 changes: 0 additions & 11 deletions spec/directives/function/escaped.hrx

This file was deleted.

18 changes: 18 additions & 0 deletions spec/directives/mixin.hrx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<===> custom_ident_name/input.scss
@mixin --a {b: c}
d {@include --a}

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

<===> custom_ident_name/warning
DEPRECATION WARNING on line 1, column 8 of input.scss:
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
,
1 | @mixin --a {b: c}
| ^^^
'
Loading