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

docs: Tailwind plugin #26

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
```