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 support for basic addVariant plugins with new @plugin directive #13982

Merged
merged 17 commits into from
Jul 11, 2024

Conversation

adamwathan
Copy link
Member

This PR adds support for a new @plugin directive as a first step towards reintroducing compatibility with v3 plugins:

@import "tailwindcss";
@plugin "my-plugin";

This PR only introduces support for the addVariant API for now, with support for the other plugin APIs planned for separate PRs.

Just like v3, plugins are JS files that look like this:

// my-plugin.js
module.exports = function ({ addVariant }) {
  addVariant('hocus', ['&:hover', '&:focus'])
}

This PR doesn't reintroduce the tailwindcss/plugin export yet that you can use to wrap plugins that support configuration options, but planning to reintroduce that as well to ensure old plugins continue to work.

@adamwathan adamwathan merged commit 5447408 into next Jul 11, 2024
1 check passed
@adamwathan adamwathan deleted the v4-plugin-api-again branch July 11, 2024 13:47
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.

2 participants