Skip to content

Commit

Permalink
Add deprecation tests for custom-ident functions and mixins (#1982)
Browse files Browse the repository at this point in the history
See #1962
  • Loading branch information
nex3 authored Apr 30, 2024
1 parent 4cded21 commit f801732
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 11 deletions.
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}
| ^^^
'

0 comments on commit f801732

Please sign in to comment.