Skip to content

Commit f801732

Browse files
authored
Add deprecation tests for custom-ident functions and mixins (#1982)
See #1962
1 parent 4cded21 commit f801732

File tree

4 files changed

+51
-11
lines changed

4 files changed

+51
-11
lines changed

js-api-spec/deprecations.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const activeDeprecations: {[key in keyof Deprecations]?: string} = {
3838
'null-alpha': '1.62.3',
3939
'abs-percent': '1.65.0',
4040
'fs-importer-cwd': '1.73.0',
41+
'css-function-mixin': '1.76.0',
4142
};
4243

4344
/**

spec/directives/function.hrx

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<===> escaped/input.scss
2+
// Function names can be defined and referred to using escapes, which are
3+
// normalized.
4+
@function f\6Fo-bar() {@return 1}
5+
6+
a {b: foo-b\61r()}
7+
8+
<===> escaped/output.css
9+
a {
10+
b: 1;
11+
}
12+
13+
<===>
14+
================================================================================
15+
<===> custom_ident_name/input.scss
16+
@function --a() {@return 1}
17+
b {c: --a()}
18+
19+
<===> custom_ident_name/output.css
20+
b {
21+
c: 1;
22+
}
23+
24+
<===> custom_ident_name/warning
25+
DEPRECATION WARNING on line 1, column 11 of input.scss:
26+
Sass @function names beginning with -- are deprecated for forward-compatibility with plain CSS mixins.
27+
28+
For details, see https://sass-lang.com/d/css-function-mixin
29+
,
30+
1 | @function --a() {@return 1}
31+
| ^^^
32+
'

spec/directives/function/escaped.hrx

-11
This file was deleted.

spec/directives/mixin.hrx

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<===> custom_ident_name/input.scss
2+
@mixin --a {b: c}
3+
d {@include --a}
4+
5+
<===> custom_ident_name/output.css
6+
d {
7+
b: c;
8+
}
9+
10+
<===> custom_ident_name/warning
11+
DEPRECATION WARNING on line 1, column 8 of input.scss:
12+
Sass @mixin names beginning with -- are deprecated for forward-compatibility with plain CSS mixins.
13+
14+
For details, see https://sass-lang.com/d/css-function-mixin
15+
,
16+
1 | @mixin --a {b: c}
17+
| ^^^
18+
'

0 commit comments

Comments
 (0)