happy-css-modules
happy-css-modules copied to clipboard
Support for `@value` definitions
Hey! Off the back of https://github.com/mizdra/happy-css-modules/issues/200#issuecomment-1539878340 I wondered if you may consider support for @value
variables:
@value foo: anything;
import styles from './file.css'
styles.foo // string
This would match the behaviour of Webpack and typed-css-modules.
Cheers!
Thanks for the proposal!
I misunderstood the behavior with @value
. I see that values defined with @value
are also exported (I created a demo project to confirm this behavior).
- https://github.com/mizdra/playground-css-loader/tree/e9ca040a7169b838e4b0d99ef6f49e11b5d21721
Surely it would be desirable to support this behavior in happy-css-modules as well. I will consider implementing it.
I was too busy to work on it. However, I will resume this work when I have time. Please wait for further updates!
the same with :export
from icss
@Grawl Thanks for your comment!
I thought ICSS was a syntax that bundler outputs internally, not for people to write. So happy-css-modules is not designed to work with ICSS. happy-css-modules does not have a test case for ICSS, so it is not guaranteed to work with ICSS.
If you want ICSS to work with happy-css-modules, could you please create a new issue? We need to discuss how much work is needed there.
Just didn't knew there is @value
syntax
This feature is shipped in v3.1.0
. Thanks to @samhh for contributing to this feature!
https://github.com/mizdra/happy-css-modules/releases/tag/v3.1.0