bradlc / babel-plugin-tailwind-components

Use Tailwind with any CSS-in-JS library
MIT License
331 stars 25 forks source link

Using Tailwind Plugins within Tailwind.js #41

Open NikkiJonesR opened 4 years ago

NikkiJonesR commented 4 years ago

Hi there,

Is it possible to load tailwind plugins and use them within my styled components?

For instance something like this?

// babel-plugin-macros.config.js
module.exports = {
  tailwind: {
    config: './tailwind.js',
    format: 'auto',
    plugins: [
      require('./src/tailwind-custom-plugins/my-tailwind-plugin.js')
    ],
  }
}

And in my tailwind.js:

...  
/*
  |-----------------------------------------------------------------------------
  | Plugins                                https://tailwindcss.com/docs/plugins
  |-----------------------------------------------------------------------------
  |
  | Here is where you can register any plugins you'd like to use in your
  | project. Tailwind's built-in `container` plugin is enabled by default to
  | give you a Bootstrap-style responsive container component out of the box.
  |
  | Be sure to view the complete plugin documentation to learn more about how
  | the plugin system works.
  |
  */

  plugins: [
    require('./src/tailwind-custom-plugins/my-tailwind-plugin.js')(),
  ],