JSPM

@salesforce-ux/postcss-annotations-parser

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q46046F
  • License SEE LICENSE file

PostCSS plugin to parse annotation comments such as `@css-var-fallback`.

Package Exports

  • @salesforce-ux/postcss-annotations-parser

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@salesforce-ux/postcss-annotations-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PostCSS Annotations Parser

NOTICE: This plugin is provided as-is without support, implied or otherwise.

PostCSS plugin to parse annotation comments such as @css-var-fallback

.foo {
    /* Input example */

    /*! @css-var-fallback border-radius */
    --sds-c-avatar-radius-border: var(--sds-g-radius-border, 12%);
}
.foo {
  /* Output example */

  border-radius: var(--sds-g-radius-border, 12%);
  --sds-c-avatar-radius-border: 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-annotations-parser'),
    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