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

feat(preset-mini): Add support for peer and group variants on aria-* variants to Preset-Mini #3692

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Johnkat-Mj
Copy link
Contributor

@Johnkat-Mj Johnkat-Mj commented Apr 6, 2024

This pull request enable the use of peer and group selectors in conjunction with ara-* variants ( #3691 )
This will provide the ability to achieve styles like:

  • peer-aria-expanded:bg-red: Applies a red background to an element when its peer element has the aria-expanded attribute set to true.

  • group-aria-expanded-p-4: Adds a padding of 4 units to elements within a group when a group member has the aria-expanded attribute set to true.

Example

<button data-accordion-trigger aria-label="toggle button"
    aria-expanded="true"
    class="... group" ...>
    Can it be animated?
    <span
        class=".... group-aria-expanded-rotate-180"></span>
</button>

In this example, the rotate-180 will be applied to the span element when the group member (button) has the aria-expanded attribute set to true.

@Johnkat-Mj Johnkat-Mj requested a review from antfu as a code owner April 6, 2024 10:39
Copy link

netlify bot commented Apr 6, 2024

Deploy Preview for unocss ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 4362a1e
🔍 Latest deploy log https://app.netlify.com/sites/unocss/deploys/6625bf4c0255c80007c21f29
😎 Deploy Preview https://deploy-preview-3692--unocss.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zyyv
Copy link
Member

zyyv commented Apr 8, 2024

@Johnkat-Mj Can you add some test cases?

@Johnkat-Mj
Copy link
Contributor Author

@zyyv Can you guide me through this?
Should I just add a usage example in EXAMPLES or should I write a test for this?

docs/presets/community.md Outdated Show resolved Hide resolved
@Johnkat-Mj Johnkat-Mj changed the title Add support for peer and group variants on aria-* variants to Preset-Mini feat(preset-mini): Add support for peer and group variants on aria-* variants to Preset-Mini Apr 8, 2024
@zyyv
Copy link
Member

zyyv commented Apr 8, 2024

@zyyv Can you guide me through this? Should I just add a usage example in EXAMPLES or should I write a test for this?

Like this

// variants - aria
'aria-[invalid=spelling]:underline-red-600',

Add your test cases, update the snapshot and check it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants