44 */
55
66const prefix = 'db' ;
7+ const fileHeader = `
8+ @use "variables" as *;
9+ // Do not edit directly
10+ // Generated on
11+ // ${ new Date ( ) . toString ( ) }
12+ ` ;
713
814const generateInteractiveVariants = ( currentColorObject , cssProp ) => {
915 return `
@@ -39,6 +45,7 @@ const generateBGVariants = (
3945%${ placeholderName } -ia-states {
4046 ${ generateInteractiveVariants ( currentColorObject , 'background-color' ) }
4147}
48+
4249%${ placeholderName } {
4350 background-color: $${ prefix } -${ currentColorObject . enabled . name } ;
4451 color: $${ prefix } -${ baseColorObject . enabled . name } ;
@@ -60,7 +67,6 @@ const generateBGVariants = (
6067 a {
6168 ${ generateInteractiveVariants ( baseColorObject , 'color' ) }
6269 }
63-
6470` ;
6571 if ( baseColorObject . weak ) {
6672 result += `
@@ -74,7 +80,8 @@ const generateBGVariants = (
7480` ;
7581 }
7682
77- result += `}` ;
83+ result += `}
84+ ` ;
7885 return result ;
7986} ;
8087
@@ -86,15 +93,25 @@ const generateBGVariants = (
8693 * @returns scss string
8794 */
8895exports . generateColorUtilitityPlaceholder = ( colorToken ) => {
89- let output = '@use "variables" as *;\n' ;
96+ let output = fileHeader ;
9097
9198 for ( const [ , value ] of Object . keys ( colorToken ) . entries ( ) ) {
92- output += `/**
99+ output += `
100+ /**
93101* ${ value . toUpperCase ( ) } - Placeholder Utilities
94102**/
95103` ;
96104 // Text colors with interactive variant, e.g. primary
97105 if ( colorToken [ value ] . enabled ) {
106+ // Only text
107+ output += `
108+ %${ prefix } -${ value } -text-ia {
109+ color: $${ prefix } -${ colorToken [ value ] . enabled . name } ;
110+ ${ generateInteractiveVariants ( colorToken [ value ] , 'color' ) }
111+ }
112+
113+ ` ;
114+
98115 // Text and background colors
99116 output += generateBGVariants (
100117 value ,
0 commit comments