File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Fixed
11
11
12
12
- Type ` tailwindFunctions ` and ` tailwindAttributes ` as optional ([ #206 ] ( https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/206 ) )
13
+ - Don’t break ` @apply … #{'!important'} ` sorting ([ #212 ] ( https://github.com/tailwindlabs/prettier-plugin-tailwindcss/pull/212 ) )
13
14
14
15
## [ 0.5.3] - 2023-08-15
15
16
Original file line number Diff line number Diff line change @@ -533,7 +533,9 @@ function transformCss(ast, { env }) {
533
533
if ( node . type === 'css-atrule' && node . name === 'apply' ) {
534
534
node . params = sortClasses ( node . params , {
535
535
env,
536
- ignoreLast : / \s + (?: ! i m p o r t a n t | # { ! i m p o r t a n t } ) \s * $ / . test ( node . params ) ,
536
+ ignoreLast : / \s + (?: ! i m p o r t a n t | # { ( [ ' " ] * ) ! i m p o r t a n t \1} ) \s * $ / . test (
537
+ node . params ,
538
+ ) ,
537
539
} )
538
540
}
539
541
} )
Original file line number Diff line number Diff line change @@ -145,7 +145,18 @@ let tests = {
145
145
// t`<div [ngClass]="{ '${no}': foo && definitely&a:syntax*error }" class="${yes}"></div>`,
146
146
] ,
147
147
css : [ ...css , t `@apply ${ yes } !important;` ] ,
148
- scss : [ ...css , t `@apply ${ yes } #{!important};` ] ,
148
+ scss : [
149
+ ...css ,
150
+ t `@apply ${ yes } #{!important};` ,
151
+ t `@apply ${ yes } #{'!important'};` ,
152
+ t `@apply ${ yes } #{"!important"};` ,
153
+
154
+ // These shouldn't ever be used but they are valid
155
+ // syntax so we might as well not break them
156
+ t `@apply ${ yes } #{""!important""};` ,
157
+ t `@apply ${ yes } #{'''!important'''};` ,
158
+ t `@apply ${ yes } #{"'"'"!important"'"'"};` ,
159
+ ] ,
149
160
less : [ ...css , t `@apply ${ yes } !important;` ] ,
150
161
babel : javascript ,
151
162
typescript : javascript ,
You can’t perform that action at this time.
0 commit comments