You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe this would be a nice and perhaps much needed feature for several use cases, especially for those architecting component-style css as well as atomic css. This feature, I will say is a mix between mixins and extend functionality. For example, I would like to include a utility class style into my component class. Extends and mixin can definitely do the job, however, the output css is not what I want from either mechanism. What I would like to happen is the component class simply inherits the style rules from another class. For example:
Now a major question would be what happens when importing in styles from a class that have nested classes? I would say to ignore the nested classes but that might be naive, but what do you think should happen?
The text was updated successfully, but these errors were encountered:
We considered this feature years ago. Less css has it, but we found it to be lacking for the following reasons:
A class or placeholder is not a singleton definition. It is a reference to an html concept. It doesn’t make sense to include it because it can exist in multiple locations. In different runtime scopes. The way to connect two selectors is with @extend. Mixins are singleton definitions so including them has well defined semantics.
I believe this would be a nice and perhaps much needed feature for several use cases, especially for those architecting component-style css as well as atomic css. This feature, I will say is a mix between mixins and extend functionality. For example, I would like to include a utility class style into my component class. Extends and mixin can definitely do the job, however, the output css is not what I want from either mechanism. What I would like to happen is the component class simply inherits the style rules from another class. For example:
.font-normal {
font-weight: 400
}
%c-orange {
color: orange;
}
.component {
@require .font-normal;
@require %c-orange;
display: block;
position: relative;
}
OUTPUTTED CSS for the component:
.component {
font-weight: 400;
color: orange;
display: block;
position: relative;
}
Now a major question would be what happens when importing in styles from a class that have nested classes? I would say to ignore the nested classes but that might be naive, but what do you think should happen?
The text was updated successfully, but these errors were encountered: