|
1 | 1 | @use 'config'; |
| 2 | +@use 'sass:string'; |
| 3 | +@use 'sass:meta'; |
2 | 4 |
|
3 | 5 | // BEM support Func |
4 | 6 | @function selectorToString($selector) { |
5 | | - $selector: inspect($selector); |
6 | | - $selector: str-slice($selector, 2, -2); |
| 7 | + $selector: meta.inspect($selector); |
| 8 | + $selector: string.slice($selector, 2, -2); |
7 | 9 | @return $selector; |
8 | 10 | } |
9 | 11 |
|
10 | 12 | @function containsModifier($selector) { |
11 | 13 | $selector: selectorToString($selector); |
12 | 14 |
|
13 | | - @if str-index($selector, config.$modifier-separator) { |
| 15 | + @if string.index($selector, config.$modifier-separator) { |
14 | 16 | @return true; |
15 | 17 | } @else { |
16 | 18 | @return false; |
|
20 | 22 | @function containWhenFlag($selector) { |
21 | 23 | $selector: selectorToString($selector); |
22 | 24 |
|
23 | | - @if str-index($selector, '.' + config.$state-prefix) { |
| 25 | + @if string.index($selector, '.' + config.$state-prefix) { |
24 | 26 | @return true; |
25 | 27 | } @else { |
26 | 28 | @return false; |
|
30 | 32 | @function containPseudoClass($selector) { |
31 | 33 | $selector: selectorToString($selector); |
32 | 34 |
|
33 | | - @if str-index($selector, ':') { |
| 35 | + @if string.index($selector, ':') { |
34 | 36 | @return true; |
35 | 37 | } @else { |
36 | 38 | @return false; |
|
81 | 83 | } |
82 | 84 |
|
83 | 85 | @function str-replace($string, $search, $replace: '') { |
84 | | - $index: str-index($string, $search); |
| 86 | + $index: string.index($string, $search); |
85 | 87 |
|
86 | 88 | @if $index { |
87 | | - @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); |
| 89 | + @return string.slice($string, 1, $index - 1) + $replace + str-replace(string.slice($string, $index + str-length($search)), $search, $replace); |
88 | 90 | } |
89 | 91 |
|
90 | 92 | @return $string; |
|
0 commit comments