PostCSS plugin to parse CSS variable `var(...)` functions to their static fallback value.
npm install @salesforce-ux/postcss-css-variable-value> NOTICE: This plugin is provided as-is without support, implied or otherwise.
[PostCSS] plugin to parse CSS variable var(...) functions to their static fallback value
[PostCSS]: https://github.com/postcss/postcss
``css
.foo {
/ Input example /
border-radius: var(--sds-g-radius-border, 12%);
}
`
`css
.foo {
/ Output example /
border-radius: 12%;
border-radius: var(--sds-g-radius-border, 12%);
}
`
Check you project for existed PostCSS config: postcss.config.js"postcss"
in the project root, section in package.jsonpostcss
or in bundle config.
If you already use PostCSS, add the plugin to plugins list:
`diff`
module.exports = {
plugins: [
+ require('postcss-css-variable-value'),
require('autoprefixer')
]
}
If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.
[official docs]: https://github.com/postcss/postcss#usage
* preserve`: if set to false the plugin will not preserve the existing declaration and overwrite instead