Skip to content

Commit

Permalink
docs: Tailwind plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbien committed Dec 6, 2023
1 parent ea0cda3 commit 5ae6406
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/frosted-ui/.storybook/stories/Tailwind.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Meta } from '@storybook/blocks';

<Meta title="Tailwind plugin" />

# Tailwind plugin

If you want to use Frosted UI with Tailwind CSS, you can use the Frosted UI Tailwind plugin.
The plugin maps all of the FUI color and font related tokens to Tailwind CSS classes.

## Usage

Add the `frostedThemePlugin` to `plugins` in your `tailwind.config.js` file.

```js
import { frostedThemePlugin } from 'frosted-ui';

export default {
darkMode: ['class'],
content: [],
theme: {
extend: {},
},
plugins: [frostedThemePlugin()],
};
```

Then you can use the Frosted UI tokens via Tailwind classes.

```tsx
<div className="text-1 leading-1 bg-gray-a2 text-success-9">Frosted UI</div>
```

0 comments on commit 5ae6406

Please sign in to comment.