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

Support sort function in matchVariant #9423

Merged
merged 2 commits into from Sep 26, 2022
Merged

Conversation

RobinMalfait
Copy link
Contributor

This will ensure that we can sort arbitrary variant values (and hardcoded values) to ensure the order.

Example:

matchVariant('min', ({ value }) => `@media (min-width: ${value})`, {
  sort(a, z) {
    return parseInt(a) - parseInt(z)
  }
})

matchVariant('max', ({ value }) => `@media (max-width: ${value})`, {
  sort(a, z) {
    return parseInt(z) - parseInt(a)
  }
})

This will ensure that we can sort arbitrary variant values (and
hardcoded values) to ensure the order.
@thecrypticace thecrypticace merged commit 26cab53 into master Sep 26, 2022
@thecrypticace thecrypticace deleted the feat/match-variant-sorting branch September 26, 2022 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants