How to use the @ui5/webcomponents/dist/assets/themes/sap_fiori_3/parameters-bundle.css.json._.replace function in @ui5/webcomponents

To help you get started, we’ve selected a few @ui5/webcomponents examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SAP / ui5-webcomponents-react / packages / base / scripts / cssVariables / parse.js View on Github external
const { writeFileSync } = require('fs');
const {
  _: Fiori3ThemingVariables
} = require('@ui5/webcomponents/dist/assets/themes/sap_fiori_3/parameters-bundle.css.json');
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]);

let fileContent = `/* 
 * ### 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'
 */

`;

for (const variable of variables) {
  fileContent += `export const ${variable.replace('--', '')} = 'var(${variable})';\n`;
}

@ui5/webcomponents

UI5 Web Components: webcomponents.main

Apache-2.0
Latest version published 12 days ago

Package Health Score

90 / 100
Full package analysis