-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ThemingParameters): Switch to offical Theme Designer Parameters (#…
- Loading branch information
1 parent
d31cf5c
commit dc6f94e
Showing
62 changed files
with
1,041 additions
and
353 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
const { writeFileSync } = require('fs'); | ||
const { | ||
_: Fiori3ThemingVariables | ||
} = require('@ui5/webcomponents/dist/assets/themes/sap_fiori_3/parameters-bundle.css.json'); | ||
const { root } = require('./themeDesignerVariables'); | ||
const PATHS = require('../../../../config/paths'); | ||
const path = require('path'); | ||
|
||
const variables = Fiori3ThemingVariables.replace(':root{', '') | ||
.replace(/}$/, '') | ||
.split(';') | ||
.filter((variable) => !/^--_?ui5/.test(variable)) | ||
.map((value) => value.split(':')[0]); | ||
const variables = Object.keys(root); | ||
|
||
let fileContent = `/* | ||
let fileContent = `/* eslint-disable camelcase */ | ||
/* | ||
* ### WARNING ### | ||
* This is an autogenerated file, do not change manually. | ||
* In order to recreate this file, please run 'node packages/base/scripts/cssVariables/parse.js' | ||
*/ | ||
`; | ||
|
||
fileContent += 'export const ThemingParameters = {\n'; | ||
for (const variable of variables) { | ||
fileContent += `export const ${variable.replace('--', '')} = 'var(${variable})';\n`; | ||
fileContent += ` '${variable}': 'var(--${variable})',\n`; | ||
} | ||
fileContent += '}\n'; | ||
|
||
writeFileSync(path.join(PATHS.packages, 'base', 'src', 'styling', 'sap_fiori_3.ts'), fileContent); | ||
writeFileSync(path.join(PATHS.packages, 'base', 'src', 'styling', 'ThemingParameters.ts'), fileContent); |
Oops, something went wrong.