@@ -1053,6 +1053,104 @@ describe('generator', () => {
10531053 ` )
10541054 } )
10551055
1056+ test ( 'themes - staticCss with multiple themes ' , ( ) => {
1057+ const css = tokenCss ( {
1058+ eject : true ,
1059+ conditions : {
1060+ osDark : '@media (prefers-color-scheme: dark)' ,
1061+ } ,
1062+ theme : {
1063+ tokens : {
1064+ colors : {
1065+ text : { value : 'blue' } ,
1066+ } ,
1067+ } ,
1068+ semanticTokens : {
1069+ colors : {
1070+ body : {
1071+ value : {
1072+ base : '{colors.blue.600}' ,
1073+ _osDark : '{colors.blue.400}' ,
1074+ } ,
1075+ } ,
1076+ } ,
1077+ } ,
1078+ } ,
1079+ // alternative theme variants
1080+ themes : {
1081+ primary : {
1082+ tokens : {
1083+ colors : {
1084+ text : { value : 'red' } ,
1085+ } ,
1086+ } ,
1087+ semanticTokens : {
1088+ colors : {
1089+ muted : { value : '{colors.red.200}' } ,
1090+ body : {
1091+ value : {
1092+ base : '{colors.red.600}' ,
1093+ _osDark : '{colors.red.400}' ,
1094+ } ,
1095+ } ,
1096+ } ,
1097+ } ,
1098+ } ,
1099+ 'primary-legacy' : {
1100+ tokens : {
1101+ colors : {
1102+ text : { value : 'blue' } ,
1103+ } ,
1104+ } ,
1105+ semanticTokens : {
1106+ colors : {
1107+ muted : { value : '{colors.blue.200}' } ,
1108+ body : {
1109+ value : {
1110+ base : '{colors.blue.600}' ,
1111+ _osDark : '{colors.blue.400}' ,
1112+ } ,
1113+ } ,
1114+ } ,
1115+ } ,
1116+ } ,
1117+ } ,
1118+ staticCss : {
1119+ // only generate the red in addition to the main one
1120+ themes : [ 'primary' ] ,
1121+ // use ['*'] to generate all themes
1122+ } ,
1123+ outdir : '' ,
1124+ } )
1125+
1126+ expect ( css ) . toMatchInlineSnapshot ( `
1127+ "@layer tokens {
1128+ :where(html) {
1129+ --colors-text: blue;
1130+ --colors-body: var(--colors-blue-600);
1131+ }
1132+
1133+ [data-panda-theme=primary] {
1134+ --colors-text: red;
1135+ --colors-muted: var(--colors-red-200);
1136+ --colors-body: var(--colors-red-600)
1137+ }
1138+
1139+ @media (prefers-color-scheme: dark) {
1140+ :where(html) {
1141+ --colors-body: var(--colors-blue-400)
1142+ }
1143+ }
1144+
1145+ @media (prefers-color-scheme: dark) {
1146+ [data-panda-theme=primary] {
1147+ --colors-body: var(--colors-red-400)
1148+ }
1149+ }
1150+ }"
1151+ ` )
1152+ } )
1153+
10561154 test ( 'themes - staticCss with *' , ( ) => {
10571155 const css = tokenCss ( {
10581156 eject : true ,
0 commit comments