Open evertheylen opened 6 months ago
If you're using Vite you could use an alias like @/colors.module.css
but I would also second this feature request. 🙏
Actually, I found out that postcss-modules-values supports this usecase through @value
.
The lightningcss website states that it doesn't support "the @value rule – superseded by standard CSS variables.". I personally see two usecases why it useful and not superseded by standard CSS variables:
The support for scoping CSS variables is great and exactly what I'd expect from CSS modules.
However, consider a CSS module that defines some theme colors:
Using the above module can get rather verbose when the directory structure of your project grows. For example, I can see this happening:
I think it would be nice to have a syntax to alias another CSS module file, something like this:
The syntax above is just an idea, I just don't want to repeat potentially long filepaths.
(I've searched for ways in which this might already be implemented, but couldn't find anything. Let me know if I'm wrong!)