File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ function postProcessStyleFunction(value: StyleDescriptor): [
614
614
let [ shouldDelay , usesVariables ] = postProcessStyleFunction ( value [ 2 ] ) ;
615
615
616
616
usesVariables ||= value [ 1 ] === "var" ;
617
- shouldDelay ||= value [ 3 ] === 1 ;
617
+ shouldDelay ||= value [ 3 ] === 1 || usesVariables ;
618
618
619
619
if ( shouldDelay ) {
620
620
return [ true , usesVariables ] ;
Original file line number Diff line number Diff line change @@ -135,3 +135,33 @@ describe("hsla", () => {
135
135
} ) ;
136
136
} ) ;
137
137
} ) ;
138
+
139
+ describe ( "currentcolor" , ( ) => {
140
+ test ( "currentcolor and global variables" , ( ) => {
141
+ registerCSS ( `
142
+ @layer theme {
143
+ :root {
144
+ --color-red-500: red;
145
+ }
146
+ }
147
+ @layer utilities {
148
+ .bg-current {
149
+ background-color: currentcolor;
150
+ }
151
+ .text-red-500 {
152
+ color: var(--color-red-500);
153
+ }
154
+ }
155
+ ` ) ;
156
+
157
+ render ( < View testID = { testID } className = "bg-current text-red-500" /> ) ;
158
+ const component = screen . getByTestId ( testID ) ;
159
+
160
+ expect ( component . type ) . toBe ( "View" ) ;
161
+ expect ( component . props ) . toStrictEqual ( {
162
+ children : undefined ,
163
+ style : { color : "red" , backgroundColor : "red" } ,
164
+ testID,
165
+ } ) ;
166
+ } ) ;
167
+ } ) ;
You can’t perform that action at this time.
0 commit comments