@salesforce-ux/postcss-css-variable-value

0.2.1 • Public • Published

PostCSS CSS variable fallback value Parser

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

.foo {
    /* Input example */

    border-radius: var(--sds-g-radius-border, 12%);
}
.foo {
  /* Output example */

  border-radius: 12%;
  border-radius: var(--sds-g-radius-border, 12%);
}

Usage

Check you project for existed PostCSS config: postcss.config.js in the project root, "postcss" section in package.json or postcss in bundle config.

If you already use PostCSS, add the plugin to plugins list:

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.

Options

  • preserve: if set to false the plugin will not preserve the existing declaration and overwrite instead

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.2.16latest

Version History

VersionDownloads (Last 7 Days)Published
0.2.16
0.2.011
0.1.11

Package Sidebar

Install

npm i @salesforce-ux/postcss-css-variable-value

Weekly Downloads

18

Version

0.2.1

License

SEE LICENSE file

Unpacked Size

9.85 kB

Total Files

5

Last publish

Collaborators

  • salesforce-ux