File tree Expand file tree Collapse file tree 1 file changed +14
-19
lines changed
Expand file tree Collapse file tree 1 file changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -376,29 +376,24 @@ export const applyGlobalTheme = (baseTheme: any, userTheme?: any): any => {
376376 * @returns string containing the component's themed CSS variables
377377 */
378378export const generateComponentsThemeCSS = ( components : any ) : string => {
379- let componentsCSS = '' ;
380- if ( components ) {
381- for ( const [ component , componentTokens ] of Object . entries ( components ) ) {
382- const componentTag = convertToKebabCase ( component ) ;
383- const vars = generateCSSVars ( componentTokens , `--${ componentTag } -` ) ;
384-
385- const componentBlock = `
386- ${ CSS_ROOT_SELECTOR } ${ componentTag } {
387- ${ vars }
388- }
389- ` ;
390-
391- // 3. Append the block to the main componentsCSS string
392- componentsCSS += componentBlock ;
393- }
379+ let css = '' ;
380+
381+ for ( const [ component , componentTokens ] of Object . entries ( components ) ) {
382+ const componentTag = convertToKebabCase ( component ) ;
383+ const vars = generateCSSVars ( componentTokens , `--${ componentTag } -` ) ;
384+
385+ const componentBlock = `
386+ ${ CSS_ROOT_SELECTOR } ${ componentTag } {
387+ ${ vars }
388+ }
389+ ` ;
390+
391+ css += componentBlock ;
394392 }
395- console . log ( 'componentsCSS' , componentsCSS ) ;
396- const css = `
397- ${ componentsCSS }
398- ` ;
399393
400394 return css ;
401395} ;
396+ } ;
402397
403398/**
404399 * Applies a component theme to an element if it exists in the custom theme
You can’t perform that action at this time.
0 commit comments