Replies: 1 comment
-
Same applies when nesting components in ui libraries. Supporting nested slots would let us expose in one go a child component's configs into the parent component. This way it would be possible to customize a particular button only when it is inside the login form compared to a checkout form |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been using
tv
for styling typography elements and found it very helpful. However, I noticed that the library only supports one level of slots, which limits its organizational capabilities. As a result, how about adding support for nested slots?I think it would enhance flexibility and give a better DX.
Nested slots can help keep the typography styles clean and organized, making it easier to reuse styles across different components. For example, I may want to apply the same typography styles to headings and subheadings, but with different sizes. With nested slots, I can create a
heading
slot that includesh1
,h2
,h3
, and so on, each with its own set of styles.Here is an example of how the syntax for nested slots could look like:
This way, I can easily access the h1 style using
typography.slots.heading.h1()
in my components, making it easier to apply the same styles across the library.I do not want to make styles for the headings, titles, paragraphs, etc...
like:
Beta Was this translation helpful? Give feedback.
All reactions