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

Sync variants #721

Merged
merged 3 commits into from Jul 2, 2022
Merged

Sync variants #721

merged 3 commits into from Jul 2, 2022

Conversation

ben-rogerson
Copy link
Owner

@ben-rogerson ben-rogerson commented Jul 1, 2022

This PR contains a bunch of changes to sync the variants a little more closely with tailwind latest.

This included moving the variant definitions into corePlugins.js so they can now be found right next to the class definitions.

Task list

  • Sync variant config with tailwindcss
  • Support customizing class name when using darkMode: 'class' (#5800)
  • Add enabled variant (#7905)
  • Add backdrop variant (#7924#8526)
  • Add prefers-contrast media query variants (#8410)
  • Add optional variant (#8486)
  • Error when registering an invalid custom variant (#8345)

Not variants

Twin now automatically generates a full set of reversed not- variants from the list of pseudoVariants:

// Positional
tw`not-first:block`
tw`not-last:block`
tw`not-only:block`
tw`not-odd:block`
tw`not-even:block`
tw`not-first-of-type:block`
tw`not-last-of-type:block`
tw`not-only-of-type:block`

// State
tw`not-visited:block`
tw`not-target:block`
tw`not-open:block`

// Forms
tw`not-default:block`
tw`not-checked:block`
tw`not-indeterminate:block`
tw`not-placeholder-shown:block`
tw`not-autofill:block`
tw`not-optional:block`
tw`not-required:block`
tw`not-valid:block`
tw`not-invalid:block`
tw`not-in-range:block`
tw`not-out-of-range:block`
tw`not-read-only:block`

// Content
tw`not-empty:block`

// Interactive
tw`not-focus-within:block`
tw`not-hover:block`
tw`not-focus:block`
tw`not-focus-visible:block`
tw`not-active:block`
tw`not-enabled:block`
tw`not-disabled:block`

// Twin custom
tw`not-all:block`
tw`not-all-child:block`
tw`not-sibling:block`
tw`not-hocus:block`
tw`not-link:block`
tw`not-read-write:block`
tw`not-svg:block`
tw`not-even-of-type:block`
tw`not-odd-of-type:block`

// These `not-` classes also apply to the `group-not-` and `peer-not-` class sets:
tw`group-not-first:block`
tw`peer-not-first:block`

@ben-rogerson ben-rogerson merged commit 7755e2a into master Jul 2, 2022
@ben-rogerson ben-rogerson deleted the feature/variant-sync branch July 2, 2022 23:33
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

1 participant