-
Hello, I've been trying to adapt my use of https://tailwindcss.com/docs/hover-focus-and-other-states#styling-based-on-parent-state to this, but I've been unable to understand how. So I'm looking to understand how to apply <details open={expanded.value} class="group">
<summary class="group-open:text-pink">
Example
</summary>
</details> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can use For instance const groups = tw.style({
// basic styles here
group: {
":hover": {
backgroundColor: "group-hover:bg-red-100",
borderColor: "group-hover:border-red-300",
},
":active": {
backgroundColor: "group-active:bg-green-300",
borderColor: "group-active:border-green-100",
},
},
}) And then apply it group's children elements.
const MyGroups = () =>
<details open={expanded.value} class="group">
<summary class={groups.class}>
Example
</summary>
</details> |
Beta Was this translation helpful? Give feedback.
You can use
tw.style
method's'group'
property to write type-safe group style classnames.For instance
And then apply it group's children elements.