File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ function postProcessStyleFunction(value: StyleDescriptor): [
614614 let [ shouldDelay , usesVariables ] = postProcessStyleFunction ( value [ 2 ] ) ;
615615
616616 usesVariables ||= value [ 1 ] === "var" ;
617- shouldDelay ||= value [ 3 ] === 1 ;
617+ shouldDelay ||= value [ 3 ] === 1 || usesVariables ;
618618
619619 if ( shouldDelay ) {
620620 return [ true , usesVariables ] ;
Original file line number Diff line number Diff line change @@ -135,3 +135,33 @@ describe("hsla", () => {
135135 } ) ;
136136 } ) ;
137137} ) ;
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