Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vielhuber/postcss-tailwind-data-attr

PostCSS plugin that moves tailwind classes to data attributes.
https://github.com/vielhuber/postcss-tailwind-data-attr

Last synced: 19 days ago
JSON representation

PostCSS plugin that moves tailwind classes to data attributes.

Awesome Lists containing this project

README

        

# PostCSS Tailwind Data Attr

[PostCSS] plugin that moves tailwind classes to data attributes.

[postcss]: https://github.com/postcss/postcss

```css
.tw-text-left {}
.md:tw-text-xl {}
```

```css
[data-tw="text-left"] {}
[data-tw="md:text-xl"] {}
```

## Installation

```sh
npm install postcss-tailwind-data-attr
```

## Usage

Check you project for existed PostCSS config: `postcss.config.js`
in the project root, `"postcss"` section in `package.json`
or `postcss` in bundle config.

If you already use PostCSS, add the plugin to plugins list:

```diff
module.exports = {
plugins: [
+ require('postcss-tailwind-data-attr'),
require('autoprefixer')
]
}
```

If you do not use PostCSS, add it according to [official docs]
and set this plugin in settings.

[official docs]: https://github.com/postcss/postcss#usage