File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -356,9 +356,24 @@ Builder.prototype.build = function(options) {
356
356
}
357
357
358
358
if ( options . inlineCssVariables === true ) {
359
- result . css = result . cssVariables + "\n" + result . css ;
359
+ let scopes ;
360
+ if ( typeof result . variables . scopes === "object" ) {
361
+ scopes = Object . keys ( result . variables . scopes ) ;
362
+ } else {
363
+ scopes = [ ] ;
364
+ }
365
+
366
+ const metadataJson = JSON . stringify ( { "Scopes" : scopes } ) ;
367
+ const libraryNameDashed = options . library . name . replace ( / \. / g, "-" ) ;
368
+ const additionalVariables = `
369
+ :root {
370
+ --sapUiTheme-${ libraryNameDashed } : true;
371
+ --sapThemeMetaData-UI5-${ libraryNameDashed } : '${ metadataJson } ';
372
+ }
373
+ ` ;
374
+ result . css = additionalVariables + result . cssVariables + "\n" + result . css ;
360
375
if ( options . rtl ) {
361
- result . cssRtl = result . cssVariables + "\n" + result . cssRtl ;
376
+ result . cssRtl = additionalVariables + result . cssVariables + "\n" + result . cssRtl ;
362
377
}
363
378
}
364
379
You can’t perform that action at this time.
0 commit comments