File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
17
17
- Skip ` calc() ` normalisation in nested ` theme() ` calls ([ #11705 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11705 ) )
18
18
- Fix incorrectly generated CSS when using square brackets inside arbitrary properties ([ #11709 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11709 ) )
19
19
- Make ` content ` optional for presets in TypeScript types ([ #11730 ] ( https://github.com/tailwindlabs/tailwindcss/pull/11730 ) )
20
+ - Handle variable colors that have variable fallback values ([ #12049 ] ( https://github.com/tailwindlabs/tailwindcss/pull/12049 ) )
20
21
21
22
## [ 3.3.3] - 2023-07-13
22
23
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i
5
5
let VALUE = / (?: \d + | \d * \. \d + ) % ? /
6
6
let SEP = / (?: \s * , \s * | \s + ) /
7
7
let ALPHA_SEP = / \s * [ , / ] \s * /
8
- let CUSTOM_PROPERTY = / v a r \( - - (?: [ ^ ) ] * ?) \) /
8
+ let CUSTOM_PROPERTY = / v a r \( - - (?: [ ^ ) ] * ?) (?: , (?: [ ^ ) ] * ? | v a r \( - - [ ^ ) ] * ? \) ) ) ? \) /
9
9
10
10
let RGB = new RegExp (
11
11
`^(rgba?)\\(\\s*(${ VALUE . source } |${ CUSTOM_PROPERTY . source } )(?:${ SEP . source } (${ VALUE . source } |${ CUSTOM_PROPERTY . source } ))?(?:${ SEP . source } (${ VALUE . source } |${ CUSTOM_PROPERTY . source } ))?(?:${ ALPHA_SEP . source } (${ VALUE . source } |${ CUSTOM_PROPERTY . source } ))?\\s*\\)$`
Original file line number Diff line number Diff line change @@ -1113,3 +1113,21 @@ crosscheck(({ stable, oxide }) => {
1113
1113
` )
1114
1114
} )
1115
1115
} )
1116
+
1117
+ it ( 'variables with variable fallback values can use opacity modifier' , async ( ) => {
1118
+ let config = {
1119
+ content : [
1120
+ {
1121
+ raw : html `<div class= "bg-[rgb(var(--some-var,var(--some-other-var)))]/50" > </ div> ` ,
1122
+ } ,
1123
+ ] ,
1124
+ }
1125
+
1126
+ let result = await run ( `@tailwind utilities;` , config )
1127
+
1128
+ expect ( result . css ) . toMatchFormattedCss ( css `
1129
+ .bg-\[rgb\(var\(--some-var\,var\(--some-other-var\)\)\)\]\/50 {
1130
+ background-color : rgb (var (--some-var , var (--some-other-var )) / 0.5 );
1131
+ }
1132
+ ` )
1133
+ } )
You can’t perform that action at this time.
0 commit comments