MadLittleMods / MadLittleMods/postcss-css-variables

Use variable only from last pseudo-element

Open
#46 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
551
Forks
63
PR merge metrics
No merged PRs in 30d

Description

Input

```css
.bar {
--color: pink;
color: var(--color);
}

.bar:active {
--color: blue;
}

.bar:hover {
--color: red;
}

.bar:focus {
--color: green;
}
```

Expected

```css
.bar {
color: pink;
}

.bar:active {
color: blue;
}

.bar:hover {
color: red;
}

.bar:focus {
color: green;
}
```

Will be transformed to (Actual)

😞

```css
.bar {
color: pink;
}

.bar:focus {
color: green;
}

.bar:hover {
color: green;
}

.bar:active {
color: green;
}
```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CSS reproduction in the issue and trace the plugin's custom-property transformation behavior. Compare the generated output with the expected output for :active, :hover, and :focus, then verify that each state retains its own variable value and add regression coverage for the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.