tailwindcss/packages
Jordan Pittman e299ea381f
Add support for the tailwindcss/plugin export (#14173)
This PR adds support for the `tailwindcss/plugin` import which has
historically been used to define custom plugins:

```js
import plugin from "tailwindcss/plugin";

export default plugin(function ({ addBase }) {
  addBase({
    // ...
  });
});
```

This also adds support for `plugin.withOptions` which was used to define
plugins that took optional initilization options when they were
registered in your `tailwind.config.js` file:

```js
import plugin from "tailwindcss/plugin";

export default plugin.withOptions((options = {}) => {
  return function ({ addBase }) {
    addBase({
      // ...
    });
  };
});
```

We've stubbed out support for the `config` argument but we're not
actually doing anything with it at the time of this PR. The scope of
this PR is just to allow people to create plugins that currently work
using the raw function syntax but using the `plugin` and
`plugin.withOptions` APIs. Support for `config` will land separately.

---------

Co-authored-by: Adam Wathan <4323180+adamwathan@users.noreply.github.com>
2024-08-13 10:25:29 -04:00
..
@tailwindcss-cli Prepare v4.0.0-alpha.19 (#14162) 2024-08-09 17:58:30 +02:00
@tailwindcss-postcss Prepare v4.0.0-alpha.19 (#14162) 2024-08-09 17:58:30 +02:00
@tailwindcss-vite Prepare v4.0.0-alpha.19 (#14162) 2024-08-09 17:58:30 +02:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
internal-postcss-fix-relative-paths Bump dependencies (#14160) 2024-08-09 16:12:24 +02:00
tailwindcss Add support for the tailwindcss/plugin export (#14173) 2024-08-13 10:25:29 -04:00
tsconfig.base.json introduce v4 codebase 2024-03-05 14:29:15 +01:00