Add a "nested" group to button to support enable group- styling it in Tailwind #466
Labels
💻 aspect: code
Concerns the software code in the repository
🧰 goal: internal improvement
Improvement that benefits maintainers, not users
good first issue
New-contributor friendly
help wanted
Open to participation from the community
🟨 priority: medium
Not blocking but should be addressed soon
🧱 stack: frontend
Related to the Nuxt frontend
Problem
VButton adds a
group
Tailwind class to support styling nested elements when the button state changes. For example, if you need the button icon to change background when the button is hovered on, you can addgroup-hover:bg-dark-charcoal
. Before Tailwind 3.2, there was no way of nesting groups, so we could not apply any styles to a button (using TW) when its parent element changed state. This was necessary, for example, to remove the border of the search type button inside the search bar when the search bar is focused.Description
Tailwind 3.2 introduces nested groups: https://tailwindcss.com/blog/tailwindcss-v3-2#nested-group-and-multiple-peer-support-using-variant-modifiers
We should add a named group to
VButton
:group/vbutton
. This will allow us to also then add named groups to search bar, and style the buttons inner elements whenever the parent element is hovered on or is focused.Alternatives
We could also use vanilla CSS for that, but we are striving to move everything to Tailwind, so it would be a step back.
The text was updated successfully, but these errors were encountered: