Skip to content

Commit 15a86a9

Browse files
pi0RomainLanzrenovate[bot]renovate-botatinux
authored
feat!: v4 (#287)
* feat!: upgrade to tailwindcss@2 (#270) * chore: add alpha release script * chore(release): 4.0.0-0 * chore(deps): update all non-major dependencies (#276) Co-authored-by: Renovate Bot <[email protected]> * chore: don't force darkMode option * chore(release): 4.0.0-1 * fix: use purge as object and force it to provide purge options * chore: update test to use purge.content * chore(release): 4.0.0-2 * chore: add postcss-nested instead of preset Waiting for csstools/postcss-preset-env#191 to be ready * chore(release): 4.0.0-3 * chore: add autoprefixer too * chore(release): 4.0.0-4 * update nuxt-postcss8 * update to @nuxt/postcss8 * chore(release): 4.0.0-5 * feat: tailwind jit (#288) * feat: add Tailwind JIT support * chore: improvements * chore: remove duplicate postcss-nested * chore: simplify * chore(release): 4.0.0-6 * generate .nuxt/tailwind.config.js and use it for tailwind options + tailwind.jit option Co-authored-by: Sébastien Chopin <[email protected]> * chore: fix lint issue * skip config dependent tests for now * chore(release): 4.0.0-7 * refactor: typescript rewrite * chore(release): 4.0.0-8 * remove wronly checked-in file * fix: dont expose config without option defined * chore(release): 4.0.0-9 * fix: revert to using object syntax * chore(release): 4.0.0-10 * chore: add _hash to tailwind config * chore: upgrade deps * chore: update jit * docs: update readme * chore(release): 4.0.0-11 * chore(release): 4.0.0-12 * docs: prepare docs * docs: fix links * fix: missing dependency * chore: upgrade docus * docs: add tailwindcss * docs: upgrade docus * docs: small improvement * docs: wtf netlify build * docs: phrasing * chore: ignore Co-authored-by: Romain Lanz <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Sébastien Chopin <[email protected]>
1 parent a133848 commit 15a86a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3876
-2526
lines changed

.eslintignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
# Common
21
node_modules
32
dist
43
.nuxt
54
coverage
6-
7-
# Plugin
8-
lib/plugin.js
5+
src/*.js

.eslintrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": [
3+
"@nuxtjs/eslint-config-typescript"
4+
]
5+
}

.eslintrc.js

-10
This file was deleted.

CHANGELOG.md

+60
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,66 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [4.0.0-12](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-11...v4.0.0-12) (2021-03-15)
6+
7+
## [4.0.0-11](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-10...v4.0.0-11) (2021-03-15)
8+
9+
## [4.0.0-10](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-9...v4.0.0-10) (2021-03-13)
10+
11+
12+
### Bug Fixes
13+
14+
* revert to using object syntax ([a8d4acf](https://github.com/nuxt-community/tailwindcss-module/commit/a8d4acfd3ee60b14858f04a6af5d938276b1aa05))
15+
16+
## [4.0.0-9](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-8...v4.0.0-9) (2021-03-13)
17+
18+
19+
### Bug Fixes
20+
21+
* dont expose config without option defined ([d98086e](https://github.com/nuxt-community/tailwindcss-module/commit/d98086e7db5e110891c0c2dd97dbc79d352cef9b))
22+
23+
## [4.0.0-8](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-7...v4.0.0-8) (2021-03-12)
24+
25+
## [4.0.0-7](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-5...v4.0.0-7) (2021-03-12)
26+
27+
28+
### Features
29+
30+
* tailwind jit ([#288](https://github.com/nuxt-community/tailwindcss-module/issues/288)) ([24dc6c0](https://github.com/nuxt-community/tailwindcss-module/commit/24dc6c028f9399a58d2e1d73021a9f6532466775))
31+
32+
## [4.0.0-6](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-5...v4.0.0-6) (2021-03-12)
33+
34+
35+
### Features
36+
37+
* tailwind jit ([#288](https://github.com/nuxt-community/tailwindcss-module/issues/288)) ([24dc6c0](https://github.com/nuxt-community/tailwindcss-module/commit/24dc6c028f9399a58d2e1d73021a9f6532466775))
38+
39+
## [4.0.0-5](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.3...v4.0.0-5) (2021-03-10)
40+
41+
## [4.0.0-4](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-3...v4.0.0-4) (2021-03-09)
42+
43+
## [4.0.0-3](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-2...v4.0.0-3) (2021-03-08)
44+
45+
## [4.0.0-2](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-1...v4.0.0-2) (2021-03-08)
46+
47+
48+
### Bug Fixes
49+
50+
* use purge as object and force it to provide purge options ([910843f](https://github.com/nuxt-community/tailwindcss-module/commit/910843f10f6da538a261dfd7726ee82aeb6db6f1))
51+
52+
## [4.0.0-1](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-0...v4.0.0-1) (2021-03-08)
53+
54+
## [4.0.0-0](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.2...v4.0.0-0) (2021-03-05)
55+
56+
57+
### ⚠ BREAKING CHANGES
58+
59+
* upgrade to tailwindcss@2 (#270)
60+
61+
### Features
62+
63+
* upgrade to tailwindcss@2 ([#270](https://github.com/nuxt-community/tailwindcss-module/issues/270)) ([8ab33b8](https://github.com/nuxt-community/tailwindcss-module/commit/8ab33b802005b80cd372e9a268e1c20ac8db8007))
64+
565
### [3.4.3](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.2...v3.4.3) (2021-03-10)
666

767

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Nuxt.js Team
3+
Copyright (c) Nuxt Community
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
## Features
1717

1818
- 👌&nbsp; Zero configuration to start *([see video](https://tailwindcss.nuxtjs.org/#quick-start))*
19-
- ⚡️&nbsp; PurgeCSS included for minimal CSS ⚡️
20-
- 🪄&nbsp; Use latest CSS features *([Stage 1](https://cssdb.org/#stage-1))*
19+
- 🗜&nbsp; PurgeCSS included for minimal CSS ⚡️
20+
- ⚡️&nbsp; Supports [Tailwind Just-In-Time](https://github.com/tailwindlabs/tailwindcss-jit)
21+
- 🪄&nbsp; Includes [PostCSS Nested](https://github.com/postcss/postcss-nested)
2122
- 🎨&nbsp; Discover your Tailwind Colors *([see video](https://tailwindcss.nuxtjs.org/#tailwind-colors))*
2223
- ⚙️&nbsp; Reference your Tailwind config in your app
2324
- 📦&nbsp; Extendable by [Nuxt modules](https://modules.nuxtjs.org/)

babel.config.js

-11
This file was deleted.

commitlint.config.js

-5
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,22 @@
11
---
2-
title: Introduction
3-
description: 'Add Tailwind CSS to your Nuxt application in seconds.'
4-
position: 1
52
category: 'Getting started'
6-
categoryPosition: 1
73
---
84

9-
<img src="/preview.png" class="light-img" />
10-
<img src="/preview-dark.png" class="dark-img" />
5+
# Introduction
116

12-
Add [Tailwind CSS](https://tailwindcss.com) to your [Nuxt](https://nuxtjs.org) application in seconds.
7+
> Add Tailwind CSS to your Nuxt application in seconds.
138
14-
<alert type="info">
15-
16-
This module default to Tailwind v1, please look at [these instructions](/setup#tailwind-2) to upgrade to Tailwind v2.
17-
18-
</alert>
9+
THis module help you setup [Tailwind CSS](https://tailwindcss.com) (version 2) to your [Nuxt](https://nuxtjs.org) application in seconds.
1910

2011
## Features
2112

22-
- 👌&nbsp; Zero configuration to start
23-
- ⚡️&nbsp; PurgeCSS included for minimal CSS ⚡️
24-
- 🪄&nbsp; Use latest CSS features *([Stage 1](https://cssdb.org/#stage-1))*
25-
- 🎨&nbsp; Discover your Tailwind configuration *([see video](/#tailwind-colors))*
13+
- 👌&nbsp; Zero configuration to start *([see video](https://tailwindcss.nuxtjs.org/#quick-start))*
14+
- 🗜&nbsp; PurgeCSS included for minimal CSS ⚡️
15+
- ⚡️&nbsp; Supports [Tailwind Just-In-Time](https://github.com/tailwindlabs/tailwindcss-jit)
16+
- 🪄&nbsp; Includes [PostCSS Nested](https://github.com/postcss/postcss-nested)
17+
- 🎨&nbsp; Discover your Tailwind Colors *([see video](https://tailwindcss.nuxtjs.org/#tailwind-colors))*
18+
- ⚙️&nbsp; Reference your Tailwind config in your app
2619
- 📦&nbsp; Extendable by [Nuxt modules](https://modules.nuxtjs.org/)
27-
- ⚙️&nbsp; Reference your Tailwind config in your app
28-
29-
<p class="flex items-center">Enjoy a documentation with light and dark mode:&nbsp;<app-color-switcher class="flex"></app-color-switcher></p>
3020

3121
## Videos
3222

@@ -46,4 +36,4 @@ This module default to Tailwind v1, please look at [these instructions](/setup#t
4636
<source src="https://res.cloudinary.com/nuxt/video/upload/q_auto/v1608225750/nuxt-tailwind-viewer_ktowjm.ogv" type="video/ogg" />
4737
</video>
4838

49-
Learn more about the [Tailwind viewer](/tailwind-viewer).
39+
Learn more about the [Tailwind viewer](/tailwind/viewer).

docs/content/2.setup.md

+130
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
category: Getting started
3+
---
4+
5+
# Setup
6+
7+
> Using TailwindCSS in your Nuxt project is only one command away ✨
8+
9+
## Prerequisites
10+
11+
Tailwind 2 needs PostCSS 8, to work with Nuxt 2, this module uses [@nuxt/postcss8](https://github.com/nuxt/postcss8) that requires Nuxt `>= 2.15.3`.
12+
13+
<d-alert>
14+
15+
Please make sure to update your Nuxt version to be minimum [v2.15.3](https://github.com/nuxt/nuxt.js/releases/tag/v2.15.3).
16+
17+
</d-alert>
18+
19+
<d-code-group>
20+
<d-code-block label="Yarn" active>
21+
22+
```bash
23+
yarn upgrade nuxt
24+
```
25+
26+
</d-code-block>
27+
<d-code-block label="NPM">
28+
29+
```bash
30+
npm update nuxt
31+
```
32+
33+
</d-code-block>
34+
</d-code-group>
35+
36+
37+
## Installation
38+
39+
1. Add `@nuxtjs/tailwindcss` and `postcss` dependencies to your project:
40+
41+
<d-code-group>
42+
<d-code-block label="Yarn" active>
43+
44+
```bash
45+
yarn add --dev @nuxtjs/tailwindcss postcss@latest
46+
```
47+
48+
</d-code-block>
49+
<d-code-block label="NPM">
50+
51+
```bash
52+
npm install --save-dev @nuxtjs/tailwindcss postcss@latest
53+
```
54+
55+
</d-code-block>
56+
</d-code-group>
57+
58+
2. Add it to your `buildModules` section in your `nuxt.config.js`:
59+
60+
```ts [nuxt.config.js]
61+
export default {
62+
buildModules: ['@nuxtjs/tailwindcss']
63+
}
64+
```
65+
66+
3. Create your `tailwind.config.js` running:
67+
68+
```bash
69+
npx tailwindcss init
70+
```
71+
72+
<d-alert type="success">
73+
74+
That's it! You can now use Tailwind classes in your Nuxt app ✨
75+
76+
</d-alert>
77+
78+
<d-alert type="info">
79+
80+
Discover your color palette based on your Tailwind config with the [Tailwind viewer](/tailwind/viewer).
81+
82+
</d-alert>
83+
84+
85+
## Tailwind Just-In-Time
86+
87+
Tailwind recelently released [@tailwindcss/jit](https://github.com/tailwindlabs/tailwindcss-jit) to make the web development much faster.
88+
89+
To activate the option, set `jit: true` in your `nuxt.config.js`:
90+
91+
```ts [nuxt.config.js]
92+
export default {
93+
tailwindcss: {
94+
jit: true
95+
}
96+
}
97+
```
98+
99+
Restart your Nuxt server and see how fast it is now ⚡️
100+
101+
## Tailwind Files
102+
103+
When running `nuxt dev`, this module will look for these two files:
104+
105+
- `./assets/css/tailwind.css`
106+
- `./tailwind.config.js`
107+
108+
If they don't exist, the module will inject a basic configuration for each one so you don't have to create these files.
109+
110+
<d-alert type="info">
111+
112+
You can configure the paths in the [module options](/options).
113+
114+
</d-alert>
115+
116+
Learn more about overwriting the Tailwind configuration in the [Tailwind Config](/tailwind/config) section.
117+
118+
## Options
119+
120+
You can customize the module behaviour by using the `tailwindcss` property in `nuxt.config.js`:
121+
122+
```ts [nuxt.config.js]
123+
export default {
124+
tailwindcss: {
125+
// Options
126+
}
127+
}
128+
```
129+
130+
See the [module options](/options).

0 commit comments

Comments
 (0)