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 think we could very easily support this by supporting a special keyword :composes in the root style. Here you just pass a class name, or a vector of class names, presumably from calling a defclass style (eg: (style-class)), or by doing a (:class (style-attrs)) thing, if you really want to. So it might look like this:
Refs #1
Uses the same `composes` key that css-modules uses.
This is actually pretty straightforward. By just using the method
call within the style factory, we know that the style element will
be inserted, and we are given the class name directly, so we can
just insert that into the string of classes returned from our
method.
It'd be cool to support :composes in child definitions, but since
it's implemented by concat'ing class names it doesn't seem possible.
For that purpose you would just create a separate def* and use it
on the children directly.
* Add support for top-level style composition
Refs #1
Uses the same `composes` key that css-modules uses.
This is actually pretty straightforward. By just using the method
call within the style factory, we know that the style element will
be inserted, and we are given the class name directly, so we can
just insert that into the string of classes returned from our
method.
It'd be cool to support :composes in child definitions, but since
it's implemented by concat'ing class names it doesn't seem possible.
For that purpose you would just create a separate def* and use it
on the children directly.
* Allow using defattrs styles in :composes without `(:class)` wrapper
I think we could very easily support this by supporting a special keyword
:composes
in the root style. Here you just pass a class name, or a vector of class names, presumably from calling adefclass
style (eg:(style-class)
), or by doing a(:class (style-attrs))
thing, if you really want to. So it might look like this:Seems very intuitive to me.
The text was updated successfully, but these errors were encountered: