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
Currently, Unocss does not support applying utility variants for ARIA attributes (such as aria-expanded) in conjunction with peer or group selectors. This means we cannot style elements based on the state of a related element using ara-* variants within peer or group selectors
Suggested solution
Extending Unocss to allow using peer and group selectors with ara-* variants. This would enable more granular and dynamic styling based on ARIA attributes. Here's an example:
<button data-accordion-trigger aria-label="toggle button"
class="... group" ...>
Can it be animated?
<span
class=".... group-aria-expanded-rotate-180"></span>
</button>
Currently, to accomplish the same effect, I have to write code like this:
<button data-accordion-trigger aria-label="toggle button"
class="... [&[aria-expanded=true]>span]-rotate-180" ...>
Can it be animated?
<span data-trigger-icon
class="ease-linear duration-300 ..."></span>
</button>
This would enable flexible and accessible styling for components based on changes in aria attribute states. It would enhance the maintainability and reusability of components by separating styling logic from component logic like in the given example.
Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
Johnkat-Mj
changed the title
Add support for peer and group variants on ara-* variants
Add support for peer and group variants on aria-* variants
Apr 5, 2024
Johnkat-Mj
added a commit
to Johnkat-Mj/unocss
that referenced
this issue
Apr 6, 2024
Clear and concise description of the problem
Currently, Unocss does not support applying utility variants for ARIA attributes (such as aria-expanded) in conjunction with peer or group selectors. This means we cannot style elements based on the state of a related element using ara-* variants within peer or group selectors
Suggested solution
Extending Unocss to allow using peer and group selectors with ara-* variants. This would enable more granular and dynamic styling based on ARIA attributes. Here's an example:
Currently, to accomplish the same effect, I have to write code like this:
This would enable flexible and accessible styling for components based on changes in aria attribute states. It would enhance the maintainability and reusability of components by separating styling logic from component logic like in the given example.
Alternative
No response
Additional context
No response
Validations
README.md
of using the package.The text was updated successfully, but these errors were encountered: