MadLittleMods / MadLittleMods/postcss-css-variables
Variable fallback not working
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 551
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
I'm using postcss-css-variables with a JSON file with this data:
{
"variables" : {
"--color-form-selected" : "red",
"--color-positive-green" : "green"
}
}
On this css which uses variable fallbacks but oddly it chooses the last variable provided instead of the first.
.a-checkbox__input:checked ~ .a-checkbox__label {
background-color: var(--color-form-selected);
border-color: var(--color-positive-green, var(--color-form-selected));
}
But it outputs
.a-checkbox__input:checked ~ .a-checkbox__label {
background-color: red;
border-color: red;
}
Expected
.a-checkbox__input:checked ~ .a-checkbox__label {
background-color: red;
border-color: green;
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the JSON variables and CSS fallback example in the issue as a regression case, then trace the plugin's variable-fallback handling. Done means the nested fallback preserves the defined green value and produces the expected CSS output without changing the other variable replacement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100