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

feat!: v4 #287

Merged
merged 48 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8ab33b8
feat!: upgrade to tailwindcss@2 (#270)
RomainLanz Mar 5, 2021
f731447
chore: add alpha release script
pi0 Mar 5, 2021
6dfb571
chore(release): 4.0.0-0
pi0 Mar 5, 2021
6b436af
chore(deps): update all non-major dependencies (#276)
renovate[bot] Mar 5, 2021
38b45f9
Merge branch 'main' into dev
pi0 Mar 5, 2021
6fd5640
chore: don't force darkMode option
atinux Mar 8, 2021
50e8b8b
chore(release): 4.0.0-1
atinux Mar 8, 2021
910843f
fix: use purge as object and force it to provide purge options
atinux Mar 8, 2021
389b211
chore: update test to use purge.content
atinux Mar 8, 2021
d532723
chore(release): 4.0.0-2
atinux Mar 8, 2021
bb9904a
chore: add postcss-nested instead of preset
atinux Mar 8, 2021
089180d
chore(release): 4.0.0-3
atinux Mar 8, 2021
57a17d9
chore: add autoprefixer too
atinux Mar 9, 2021
60295c9
chore(release): 4.0.0-4
atinux Mar 9, 2021
1830ce5
Merge branch 'main' into dev
pi0 Mar 10, 2021
a3767cb
update nuxt-postcss8
pi0 Mar 10, 2021
4d47977
update to @nuxt/postcss8
pi0 Mar 10, 2021
a787c09
chore(release): 4.0.0-5
pi0 Mar 10, 2021
24dc6c0
feat: tailwind jit (#288)
atinux Mar 12, 2021
0b5ecbb
chore(release): 4.0.0-6
atinux Mar 12, 2021
0601ed3
generate .nuxt/tailwind.config.js and use it for tailwind options + t…
pi0 Mar 12, 2021
19f9ce5
chore: fix lint issue
pi0 Mar 12, 2021
b598c90
skip config dependent tests for now
pi0 Mar 12, 2021
3cdd36f
chore(release): 4.0.0-7
pi0 Mar 12, 2021
bc20e2c
refactor: typescript rewrite
pi0 Mar 12, 2021
e9eb8df
chore(release): 4.0.0-8
pi0 Mar 12, 2021
caa15ac
remove wronly checked-in file
pi0 Mar 12, 2021
d98086e
fix: dont expose config without option defined
atinux Mar 13, 2021
08ec1dc
chore(release): 4.0.0-9
atinux Mar 13, 2021
a8d4acf
fix: revert to using object syntax
atinux Mar 13, 2021
826e67c
chore(release): 4.0.0-10
atinux Mar 13, 2021
8267a56
chore: add _hash to tailwind config
pi0 Mar 13, 2021
996962e
chore: upgrade deps
atinux Mar 15, 2021
fd5c2d4
chore: update jit
atinux Mar 15, 2021
e1a7618
docs: update readme
atinux Mar 15, 2021
790ff13
chore(release): 4.0.0-11
atinux Mar 15, 2021
9b79b7b
chore(release): 4.0.0-12
atinux Mar 15, 2021
6ebe0f6
docs: prepare docs
atinux Mar 15, 2021
4ee99fa
docs: fix links
atinux Mar 15, 2021
7f2a616
Merge branch 'main' into dev
atinux Mar 15, 2021
be1f4fd
fix: missing dependency
atinux Mar 15, 2021
e46b35b
chore: upgrade docus
atinux Mar 15, 2021
e3e5ab1
docs: add tailwindcss
atinux Mar 15, 2021
aa86b3d
docs: upgrade docus
atinux Mar 15, 2021
3d4f73b
docs: small improvement
atinux Mar 15, 2021
bbfe969
docs: wtf netlify build
atinux Mar 15, 2021
621d10b
docs: phrasing
atinux Mar 15, 2021
e0c42db
chore: ignore
atinux Mar 15, 2021
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
5 changes: 1 addition & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Common
node_modules
dist
.nuxt
coverage

# Plugin
lib/plugin.js
src/*.js
5 changes: 5 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": [
"@nuxtjs/eslint-config-typescript"
]
}
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

60 changes: 60 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@

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.

## [4.0.0-12](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-11...v4.0.0-12) (2021-03-15)

## [4.0.0-11](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-10...v4.0.0-11) (2021-03-15)

## [4.0.0-10](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-9...v4.0.0-10) (2021-03-13)


### Bug Fixes

* revert to using object syntax ([a8d4acf](https://github.com/nuxt-community/tailwindcss-module/commit/a8d4acfd3ee60b14858f04a6af5d938276b1aa05))

## [4.0.0-9](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-8...v4.0.0-9) (2021-03-13)


### Bug Fixes

* dont expose config without option defined ([d98086e](https://github.com/nuxt-community/tailwindcss-module/commit/d98086e7db5e110891c0c2dd97dbc79d352cef9b))

## [4.0.0-8](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-7...v4.0.0-8) (2021-03-12)

## [4.0.0-7](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-5...v4.0.0-7) (2021-03-12)


### Features

* tailwind jit ([#288](https://github.com/nuxt-community/tailwindcss-module/issues/288)) ([24dc6c0](https://github.com/nuxt-community/tailwindcss-module/commit/24dc6c028f9399a58d2e1d73021a9f6532466775))

## [4.0.0-6](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-5...v4.0.0-6) (2021-03-12)


### Features

* tailwind jit ([#288](https://github.com/nuxt-community/tailwindcss-module/issues/288)) ([24dc6c0](https://github.com/nuxt-community/tailwindcss-module/commit/24dc6c028f9399a58d2e1d73021a9f6532466775))

## [4.0.0-5](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.3...v4.0.0-5) (2021-03-10)

## [4.0.0-4](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-3...v4.0.0-4) (2021-03-09)

## [4.0.0-3](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-2...v4.0.0-3) (2021-03-08)

## [4.0.0-2](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-1...v4.0.0-2) (2021-03-08)


### Bug Fixes

* use purge as object and force it to provide purge options ([910843f](https://github.com/nuxt-community/tailwindcss-module/commit/910843f10f6da538a261dfd7726ee82aeb6db6f1))

## [4.0.0-1](https://github.com/nuxt-community/tailwindcss-module/compare/v4.0.0-0...v4.0.0-1) (2021-03-08)

## [4.0.0-0](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.2...v4.0.0-0) (2021-03-05)


### ⚠ BREAKING CHANGES

* upgrade to tailwindcss@2 (#270)

### Features

* upgrade to tailwindcss@2 ([#270](https://github.com/nuxt-community/tailwindcss-module/issues/270)) ([8ab33b8](https://github.com/nuxt-community/tailwindcss-module/commit/8ab33b802005b80cd372e9a268e1c20ac8db8007))

### [3.4.3](https://github.com/nuxt-community/tailwindcss-module/compare/v3.4.2...v3.4.3) (2021-03-10)


Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 Nuxt.js Team
Copyright (c) Nuxt Community

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
## Features

- 👌  Zero configuration to start *([see video](https://tailwindcss.nuxtjs.org/#quick-start))*
- ⚡️  PurgeCSS included for minimal CSS ⚡️
- 🪄  Use latest CSS features *([Stage 1](https://cssdb.org/#stage-1))*
- 🗜  PurgeCSS included for minimal CSS ⚡️
- ⚡️  Supports [Tailwind Just-In-Time](https://github.com/tailwindlabs/tailwindcss-jit)
- 🪄  Includes [PostCSS Nested](https://github.com/postcss/postcss-nested)
- 🎨  Discover your Tailwind Colors *([see video](https://tailwindcss.nuxtjs.org/#tailwind-colors))*
- ⚙️  Reference your Tailwind config in your app
- 📦  Extendable by [Nuxt modules](https://modules.nuxtjs.org/)
Expand Down
11 changes: 0 additions & 11 deletions babel.config.js

This file was deleted.

5 changes: 0 additions & 5 deletions commitlint.config.js

This file was deleted.

30 changes: 10 additions & 20 deletions docs/content/en/index.md → docs/content/1.index.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
---
title: Introduction
description: 'Add Tailwind CSS to your Nuxt application in seconds.'
position: 1
category: 'Getting started'
categoryPosition: 1
---

<img src="/preview.png" class="light-img" />
<img src="/preview-dark.png" class="dark-img" />
# Introduction

Add [Tailwind CSS](https://tailwindcss.com) to your [Nuxt](https://nuxtjs.org) application in seconds.
> Add Tailwind CSS to your Nuxt application in seconds.

<alert type="info">

This module default to Tailwind v1, please look at [these instructions](/setup#tailwind-2) to upgrade to Tailwind v2.

</alert>
THis module help you setup [Tailwind CSS](https://tailwindcss.com) (version 2) to your [Nuxt](https://nuxtjs.org) application in seconds.

## Features

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

<p class="flex items-center">Enjoy a documentation with light and dark mode:&nbsp;<app-color-switcher class="flex"></app-color-switcher></p>

## Videos

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

Learn more about the [Tailwind viewer](/tailwind-viewer).
Learn more about the [Tailwind viewer](/tailwind/viewer).
130 changes: 130 additions & 0 deletions docs/content/2.setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
---
category: Getting started
---

# Setup

> Using TailwindCSS in your Nuxt project is only one command away ✨

## Prerequisites

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`.

<d-alert>

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).

</d-alert>

<d-code-group>
<d-code-block label="Yarn" active>

```bash
yarn upgrade nuxt
```

</d-code-block>
<d-code-block label="NPM">

```bash
npm update nuxt
```

</d-code-block>
</d-code-group>


## Installation

1. Add `@nuxtjs/tailwindcss` and `postcss` dependencies to your project:

<d-code-group>
<d-code-block label="Yarn" active>

```bash
yarn add --dev @nuxtjs/tailwindcss postcss@latest
```

</d-code-block>
<d-code-block label="NPM">

```bash
npm install --save-dev @nuxtjs/tailwindcss postcss@latest
```

</d-code-block>
</d-code-group>

2. Add it to your `buildModules` section in your `nuxt.config.js`:

```ts [nuxt.config.js]
export default {
buildModules: ['@nuxtjs/tailwindcss']
}
```

3. Create your `tailwind.config.js` running:

```bash
npx tailwindcss init
```

<d-alert type="success">

That's it! You can now use Tailwind classes in your Nuxt app ✨

</d-alert>

<d-alert type="info">

Discover your color palette based on your Tailwind config with the [Tailwind viewer](/tailwind/viewer).

</d-alert>


## Tailwind Just-In-Time

Tailwind recelently released [@tailwindcss/jit](https://github.com/tailwindlabs/tailwindcss-jit) to make the web development much faster.

To activate the option, set `jit: true` in your `nuxt.config.js`:

```ts [nuxt.config.js]
export default {
tailwindcss: {
jit: true
}
}
```

Restart your Nuxt server and see how fast it is now ⚡️

## Tailwind Files

When running `nuxt dev`, this module will look for these two files:

- `./assets/css/tailwind.css`
- `./tailwind.config.js`

If they don't exist, the module will inject a basic configuration for each one so you don't have to create these files.

<d-alert type="info">

You can configure the paths in the [module options](/options).

</d-alert>

Learn more about overwriting the Tailwind configuration in the [Tailwind Config](/tailwind/config) section.

## Options

You can customize the module behaviour by using the `tailwindcss` property in `nuxt.config.js`:

```ts [nuxt.config.js]
export default {
tailwindcss: {
// Options
}
}
```

See the [module options](/options).
Loading