File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
88## [ Unreleased]
99
10- - Nothing yet!
10+ - Fix class detection in Slim templates with attached attributes and ID ( [ # 14019 ] ( https://github.com/tailwindlabs/tailwindcss/pull/14019 ) )
1111
1212## [ 3.4.6] - 2024-07-16
1313
Original file line number Diff line number Diff line change @@ -152,6 +152,9 @@ function* buildRegExps(context) {
152152 utility ,
153153 ] )
154154 }
155+
156+ // 5. Inner matches
157+ yield / [ ^ < > " ' ` \s . ( ) { } [ \] # = % $ ] [ ^ < > " ' ` \s ( ) { } [ \] # = % $ ] * [ ^ < > " ' ` \s . ( ) { } [ \] # = % : $ ] / g
155158}
156159
157160// We want to capture any "special" characters
Original file line number Diff line number Diff line change @@ -486,6 +486,26 @@ test('classes in slim templates starting with number', async () => {
486486 expect ( extractions ) . toContain ( '2xl:bg-red-300' )
487487} )
488488
489+ test ( 'classes in slim templates with attributes added' , ( ) => {
490+ let extractions = defaultExtractor ( `
491+ .ml-auto[
492+ data-value='foo'
493+ ]
494+ Foo bar
495+ .mr-auto[data-value='foo']
496+ Foo bar
497+ .mt-auto#omg
498+ Foo bar
499+ #omg.mb-auto
500+ Foo bar
501+ ` )
502+
503+ expect ( extractions ) . toContain ( `ml-auto` )
504+ expect ( extractions ) . toContain ( `mr-auto` )
505+ expect ( extractions ) . toContain ( `mt-auto` )
506+ expect ( extractions ) . toContain ( `mb-auto` )
507+ } )
508+
489509test ( "classes with fractional numeric values don't also generate the whole number utility" , async ( ) => {
490510 const extractions = defaultExtractor ( `
491511 <div class="px-1.5 py-2.75">Hello world!</div>
You can’t perform that action at this time.
0 commit comments