Skip to content

Commit b4063fc

Browse files
committed
docs: update
1 parent 9d297b2 commit b4063fc

File tree

3 files changed

+45
-70
lines changed

3 files changed

+45
-70
lines changed

README.md

Lines changed: 44 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,37 @@
1-
<p align="center"><img src="https://user-images.githubusercontent.com/904724/59274615-fcef5780-8c5a-11e9-8b17-5c4915895144.png" alt="tailwindcss-module" width="500"/></p>
2-
<p align="center">
3-
<a href="https://npmjs.com/package/@nuxtjs/tailwindcss"><img src="https://img.shields.io/npm/v/@nuxtjs/tailwindcss/latest.svg" alt="npm downloads"></a>
4-
<a href="https://npmjs.com/package/@nuxtjs/tailwindcss"><img src="https://img.shields.io/npm/dt/@nuxtjs/tailwindcss.svg" alt="npm version"></a>
5-
<a href="https://github.com/nuxt-community/tailwindcss-module/actions?query=workflow%3Aci"><img src="https://github.com/nuxt-community/tailwindcss-module/workflows/ci/badge.svg" alt="github ci"></a>
6-
<a href="https://codecov.io/gh/nuxt-community/tailwindcss-module"><img src="https://img.shields.io/codecov/c/github/nuxt-community/tailwindcss-module.svg" alt="coverage"></a>
7-
<a href="https://www.npmjs.com/package/@nuxtjs/tailwindcss"><img src="https://badgen.net/npm/license/@nuxtjs/tailwindcss" alt="License"></a>
8-
</p>
1+
[![@nuxtjs/storybook](https://storybook.nuxtjs.org/preview.png)](https://storybook.nuxtjs.org)
2+
3+
# @nuxtjs/tailwindcss
4+
5+
[![npm version][npm-version-src]][npm-version-href]
6+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
7+
[![Github Actions CI][github-actions-ci-src]][github-actions-ci-href]
8+
[![Codecov][codecov-src]][codecov-href]
9+
[![License][license-src]][license-href]
910

1011
> [Tailwind CSS](https://tailwindcss.com) module for [NuxtJS](https://nuxtjs.org) with [modern css](https://tailwindcss.com/docs/using-with-preprocessors#future-css-features) ⚡️
1112
12-
## Infos
13+
- [&nbsp;Release Notes](https://tailwindcss.nuxtjs.org/releases)
14+
- [📖 &nbsp;Documentation](https://tailwindcss.nuxtjs.org)
15+
16+
## Features
1317

14-
- 📖 [Release Notes](https://github.com/nuxt-community/tailwindcss-module/releases)
15-
- 🏀 [Online playground](https://codesandbox.io/s/o4vn5pvp7q)
16-
- 🌿 [CSS Nesting Module Draft](https://drafts.csswg.org/css-nesting-1/)
17-
- 📐 [Display your breakpoints with nuxt-breaky](https://github.com/teamnovu/nuxt-breaky)
18-
- 🌓 [Dark mode example](https://codesandbox.io/s/nuxt-dark-tailwindcss-17g2j?file=/tailwind.config.js) with [tailwindcss-dark-mode](https://github.com/ChanceArthur/tailwindcss-dark-mode) and [@nuxtjs/color-mode](https://github.com/nuxt-community/color-mode-module)
18+
- Zero configuration to start
19+
- PurgeCSS included for minimal CSS
20+
- Use latest CSS features (Stage 1)
21+
- Reference your Tailwind config in your app
22+
- Extendable by Nuxt modules
1923

20-
## Setup
24+
[📖 &nbsp;Read more](https://tailwindcss.nuxtjs.org)
25+
26+
## Quick Setup
2127

2228
1. Add `@nuxtjs/tailwindcss` dependency to your project
29+
2330
```bash
24-
npm install --save-dev @nuxtjs/tailwindcss # or yarn add --dev @nuxtjs/tailwindcss
31+
# Using npm
32+
npm install --save-dev @nuxtjs/tailwindcss
33+
# Using yarn
34+
yarn add --dev @nuxtjs/tailwindcss
2535
```
2636

2737
2. Add `@nuxtjs/tailwindcss` to the `buildModules` section of `nuxt.config.js`
@@ -36,60 +46,9 @@ npm install --save-dev @nuxtjs/tailwindcss # or yarn add --dev @nuxtjs/tailwindc
3646

3747
ℹ️ If you are using `nuxt < 2.9.0`, use `modules` property instead.
3848

39-
## Usage
40-
41-
This module will automatically create two files in your [srcDir](https://nuxtjs.org/api/configuration-srcdir):
42-
- `~/tailwind.config.js`
43-
- `~/assets/css/tailwind.css`
44-
45-
It will also inject the CSS file globally and configure the [purge option](https://tailwindcss.com/docs/controlling-file-size#removing-unused-css) and [postcss-preset-env](https://preset-env.cssdb.org) to [stage 1](https://preset-env.cssdb.org/features#stage-1).
46-
47-
## Configuration
48-
49-
If you want to set a different path for the configuration file or css file, you can use these given options:
50-
51-
```js
52-
// nuxt.config.js
53-
{
54-
buildModules: [
55-
'@nuxtjs/tailwindcss'
56-
],
57-
tailwindcss: {
58-
configPath: '~/config/tailwind.config.js',
59-
cssPath: '~/assets/css/tailwind.css',
60-
exposeConfig: false
61-
}
62-
}
63-
```
64-
65-
To enable purgeCSS in development, set `purge.enabled: true` in `tailwind.config.js`, be careful that it will slow down your development process. Learn more on [removing unused CSS](https://tailwindcss.com/docs/controlling-file-size#removing-unused-css).
66-
67-
## Referencing in JavaScript
49+
That's it! You can now use Tailwind classes in your Nuxt app ✨
6850

69-
It can often be useful to reference tailwind configuration values in runtime. For example to access some of your theme values when dynamically applying inline styles in a component.
70-
71-
If you need resolved tailwind config in runtime, you can enable `exposeConfig` option in `nuxt.config`:
72-
73-
```js
74-
// nuxt.config.js
75-
{
76-
tailwindcss: {
77-
exposeConfig: true
78-
}
79-
}
80-
```
81-
82-
Then import where needed from `~tailwind.config`:
83-
84-
```js
85-
// Import fully resolved config
86-
import tailwindConfig from '~tailwind.config'
87-
88-
// Import only part which is required to allow tree-shaking
89-
import { theme } from '~tailwind.config'
90-
```
91-
92-
**NOTE:** Please be aware this adds **~19.5KB (~3.5KB)** to the client bundle size.
51+
[📖 &nbsp;Read more](https://tailwindcss.nuxtjs.org/setup)
9352

9453
## Contributing
9554

@@ -108,3 +67,19 @@ Or locally:
10867
[MIT License](./LICENSE)
10968

11069
Copyright (c) Nuxt.js Team
70+
71+
<!-- Badges -->
72+
[npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/tailwindcss/latest.svg
73+
[npm-version-href]: https://npmjs.com/package/@nuxtjs/tailwindcss
74+
75+
[npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/tailwindcss.svg
76+
[npm-downloads-href]: https://npmjs.com/package/@nuxtjs/tailwindcss
77+
78+
[github-actions-ci-src]: https://github.com/nuxt-community/tailwindcss-module/workflows/ci/badge.svg
79+
[github-actions-ci-href]: https://github.com/nuxt-community/tailwindcss-module/actions?query=workflow%3Aci
80+
81+
[codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/tailwindcss-module.svg
82+
[codecov-href]: https://codecov.io/gh/nuxt-community/tailwindcss-module
83+
84+
[license-src]: https://img.shields.io/npm/l/@nuxtjs/tailwindcss.svg
85+
[license-href]: https://npmjs.com/package/@nuxtjs/tailwindcss

docs/static/logo-light.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/static/preview.png

-3.12 KB
Loading

0 commit comments

Comments
 (0)