Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a "nested" group to button to support enable group- styling it in Tailwind #466

Closed
Tracked by #415
obulat opened this issue Feb 2, 2023 · 2 comments
Closed
Tracked by #415
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

Comments

@obulat
Copy link
Contributor

obulat commented Feb 2, 2023

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 add group-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.

@obulat obulat added good first issue New-contributor friendly help wanted Open to participation from the community 🟨 priority: medium Not blocking but should be addressed soon 💻 aspect: code Concerns the software code in the repository 🧰 goal: internal improvement Improvement that benefits maintainers, not users labels Feb 2, 2023
@dhruvkb
Copy link
Member

dhruvkb commented Feb 11, 2023

This can be taken up as a part of a more comprehensive VButton refresh currently being designed by @panchovm.

@obulat obulat transferred this issue from WordPress/openverse-frontend Feb 22, 2023
@obulat obulat added the 🧱 stack: frontend Related to the Nuxt frontend label Feb 22, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog Feb 23, 2023
@obulat
Copy link
Contributor Author

obulat commented Apr 11, 2023

Fixed in #1003

@obulat obulat closed this as completed Apr 11, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Openverse Backlog Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
Archived in project
Development

No branches or pull requests

2 participants