File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616- Move unknown pseudo-elements outside of ` :is ` by default ([ #11345 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11345 ) )
1717- Escape animation names when prefixes contain special characters ([ #11470 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11470 ) )
1818- Sort classes using position of first matching rule ([ #11504 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11504 ) )
19+ - Allow variant to be an at-rule without a prelude ([ #11589 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11589 ) )
1920
2021### Added
2122
Original file line number Diff line number Diff line change @@ -230,8 +230,8 @@ export function parseVariant(variant) {
230230 return ( { format } ) => format ( str )
231231 }
232232
233- let [ , name , params ] = / @ ( . * ? ) ( .+ | [ ( { ] .* ) / g. exec ( str )
234- return ( { wrap } ) => wrap ( postcss . atRule ( { name, params : params . trim ( ) } ) )
233+ let [ , name , params ] = / @ ( \S * ) ( .+ | [ ( { ] .* ) ? / g. exec ( str )
234+ return ( { wrap } ) => wrap ( postcss . atRule ( { name, params : params ? .trim ( ) ?? '' } ) )
235235 } )
236236 . reverse ( )
237237
Original file line number Diff line number Diff line change @@ -66,6 +66,31 @@ crosscheck(({ stable, oxide }) => {
6666 } )
6767
6868 describe ( 'custom advanced variants' , ( ) => {
69+ test ( 'at-rules without params' , ( ) => {
70+ let config = {
71+ content : [
72+ {
73+ raw : html ` <div class= "ogre:text-center" > </ div> ` ,
74+ } ,
75+ ] ,
76+ plugins : [
77+ function ( { addVariant } ) {
78+ addVariant ( 'ogre' , '@layer' )
79+ } ,
80+ ] ,
81+ }
82+
83+ return run ( '@tailwind components; @tailwind utilities' , config ) . then ( ( result ) => {
84+ return expect ( result . css ) . toMatchFormattedCss ( css `
85+ @layer {
86+ .ogre\:text-center {
87+ text-align : center;
88+ }
89+ }
90+ ` )
91+ } )
92+ } )
93+
6994 test ( 'prose-headings usage on its own' , ( ) => {
7095 let config = {
7196 content : [
You can’t perform that action at this time.
0 commit comments