-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): add support for multiple extends on a simple selector by using composition #947
Conversation
* Process multiple extends into -st-compose after the first one * Reorder resolver object * Fix bug wrong meta for local classes from parent resolution * Export multiple composed classes
A couple of questions about this:
|
PR talks about |
Yes, his suggestion is it to implement |
Didn't understand that from the description. So If true, then I'm not sure why you would add to the complexity of Also, what if a class that contains multiple composed classes is composed into another class, are all classes merged in? |
.a{
-st-extends: b;
}
.b{
-st-extends: c;
}
.c{
-st-extends: d e f;
}
.d{}
.e{}
.f{}
. export for |
I understand that now. Still think it's a mistake to complicate -st-extends. Compose can be exposed without changing extend |
Let's say it's a separate directive, then the following example is valid? .a {
-st-extends: b;
-st-composes: c;
}
.b {}
.c {
-st-composes: d;
}
.d {} export for |
Yes, I think this makes sense. I will try to sum up my reasoning for exposing I think the current behavior of
The reason root classes are not appended is because we assume that the root of a stylesheet is a component, and since the component code doesn't assume anything about the code that uses it, it will append it's own style root. So if a root class is extended, no extra class name is passed, and there is no duplicate class name in the DOM. Another benefit is that Stylable warns in development when an extending class is not applied to the component it extends. The current limitation with I think bringing back Keeping |
close in favor of progress in #2299 |
-st-compose
to StylableDirectives-st-compose
after the first oneThis feature will allow to write multiple
-st-extends
on parts. the first extends defines the type like before and the rest will be added to the JavaScript module exports.Example:
exported classes