Skip to content

Conversation

@mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Dec 19, 2024

Fixes #19

Whilst I take on board the recommendation to propose this to the css modules spec (and have done so in css-modules/css-modules#417), there really isn't really much activity going on there, even when @devongovett makes suggestions for extensions.

So, I raise this PR as a POC based on a patch I've applied locally to unlock my own project to demonstrate how it might work in practice.

I'm well aware it's missing some implementation details (composing an already composed class from another file doesn't work yet), but I just wanted to put this up.

edit: added support for composing composed classes from another file. I think it would be a lot easier to handle all classes as arrays until the last possible moment and then join them to strings only when required, but that would be a more substantial rewrite - ie, remove the join from here:

code = [exported.name, ...composedClasses.map(c => c.code)].join(' ');

@mrginglymus mrginglymus marked this pull request as ready for review January 2, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composed classes as lists

1 participant