https://github.com/josephschmitt/custom-properties-append-vars-duplicates
https://github.com/josephschmitt/custom-properties-append-vars-duplicates
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/josephschmitt/custom-properties-append-vars-duplicates
- Owner: josephschmitt
- Created: 2018-05-14T20:26:57.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-14T20:37:58.000Z (about 7 years ago)
- Last Synced: 2025-01-22T13:40:19.014Z (4 months ago)
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Duplicate Variables using `postcss-custom-properties`
I have a super simple src postcss file with two custom properties:
1. `--myColor`: Declared in a `:root` selector directly in the postcss file
2. `--myBackgroundColor`: Added via the `variables` JavaScript plugin API.After cloning the repo, run `npm install` and then `npm run build`.
## Expected Result
Running through the `postcss-custom-properties` plugin with `preserve` and `appendVariables`
produces an output file with the `--myColor` variable preserved, and the `--myBackgroundColor`
variable appended at the end of the file.## Actual Result
The output file correctly preserves the `--myColor` variable, but then it outputs it _again_
appended to the bottom of the file. This is wasteful, and gets especially bad in large projects
with lots of declared variables.