Plus methods of BaseLibrary:
This will take your CSS file (as a string) and fills the library with all necessary information
** rcs.cssVariablesLibrary.fillLibrary(code)**
Parameters:
- code
<String>
Example:
const myCssFileWithVariables = `
:root {
--my-variable: #BADA55;
}
`;
rcs.cssVariablesLibrary.fillLibrary(myCssFileWithVariables);
This will get a specific minified selector
rcs.cssVariablesLibrary.get(selector[, options])
Parameters same as Baselibrary Get
Example:
const rcs = require('rcs-core');
rcs.cssVariablesLibrary.set('--my-variable'); // sets to 'a'
rcs.cssVariablesLibrary.get('--my-variable'); // --a
rcs.cssVariablesLibrary.get('my-variable'); // a
rcs.cssVariablesLibrary.get('var(--my-variable)'); // var(--a)
rcs.cssVariablesLibrary.get('a', { isOriginalValue: false }); // my-variable
Sets a specific value into the cssVariablesLibrary
rcs.cssVariablesLibrary.set(value[, renamedValue])
Parameters same as Baselibrary Set
Example:
const rcs = require('rcs-core');
rcs.cssVariablesLibrary.set('--my-variable'); // sets to 'a'
rcs.cssVariablesLibrary.set('my--other-variable'); // sets to 'b'
rcs.cssVariablesLibrary.get('--my-variable'); // a
rcs.cssVariablesLibrary.get('--my-other-variable'); // b