lightningcss icon indicating copy to clipboard operation
lightningcss copied to clipboard

Overriding a CSS variable with CSS modules and `dashedIdents`

Open evertheylen opened this issue 1 year ago • 2 comments

Imagine I have a button component with (complex) hover states:

.button {
  --accent: red;
}

.button:hover {
  border: 1px solid var(--accent);
}

Now I want to create a variant of said button:

.other-button {
  composes: button from './button.module.css';
  --accent from './button.module.css': blue;
}

I can't write from '...' in the left hand side of that last line. How can I solve this?

(Right now, this and the other two issues I filed (#753, #763) present too much of a hurdle for me to use lightningcss)

evertheylen avatar Jun 26 '24 08:06 evertheylen