Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxt-modules/tailwindcss
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.8.1
Choose a base ref
...
head repository: nuxt-modules/tailwindcss
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.9.0
Choose a head ref
  • 5 commits
  • 21 files changed
  • 3 contributors

Commits on Oct 27, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    36b4766 View commit details

Commits on Nov 2, 2023

  1. feat: more adaptive content paths (#744)

    * chore: initial
    
    * chore: extensions
    
    * chore: update
    
    * chore: update test
    
    * chore: add conditions for composables and utils
    
    * chore: update
    
    * chore: update tests
    
    * chore: finish tests
    ineshbose authored Nov 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f7096aa View commit details
  2. feat: more customisable configuration (#743)

    * chore: initial
    
    * chore: undo pnpm stuff for now
    
    * chore: undo pnpm stuff for now
    
    * chore: revert ting
    
    * chore: add test
    
    * chore: draft viewer test
    ineshbose authored Nov 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a50c379 View commit details
  3. chore(deps): update all non-major dependencies (#742)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Nov 2, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0c6c251 View commit details
  4. chore(release): v6.9.0

    atinux committed Nov 2, 2023
    Copy the full SHA
    bd0c3a5 View commit details
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,23 @@

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.

## v6.9.0

[compare changes](https://github.com/nuxt-modules/tailwindcss/compare/v6.8.1...v6.9.0)

### 🚀 Enhancements

- More adaptive content paths ([#744](https://github.com/nuxt-modules/tailwindcss/pull/744))
- More customisable configuration ([#743](https://github.com/nuxt-modules/tailwindcss/pull/743))

### 🏡 Chore

- Add type module to packageJson ([36b4766](https://github.com/nuxt-modules/tailwindcss/commit/36b4766))

### ❤️ Contributors

- Inesh Bose

## v6.8.1

[compare changes](https://github.com/nuxt-modules/tailwindcss/compare/v6.8.0...v6.8.1)
3 changes: 1 addition & 2 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -2,8 +2,7 @@ import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
externals: [
'pathe',
'minimatch'
'pathe'
],
failOnWarn: false
})
32 changes: 3 additions & 29 deletions docs/content/1.getting-started/2.options.md
Original file line number Diff line number Diff line change
@@ -83,41 +83,14 @@ If you need to resolve the tailwind config in runtime, you can enable the `expos
export default {
tailwindcss: {
exposeConfig: true
// or, for more customisation
// exposeConfig: { level: 2, alias: '#tailwind-config' }
}
}
```

Learn more about it in the [Referencing in the application](/tailwind/config#referencing-in-the-application) section.

## `exposeLevel`

- Default: `2`

If you want to only import *really* specific parts of your tailwind config, you can enable imports for each property in the config:

```ts [nuxt.config]
export default {
tailwindcss: {
exposeConfig: true,
exposeLevel: 3
}
}
```

This is only relevant when [`exposeConfig`](/getting-started/options#exposeconfig) is set to `true`. Setting `exposeLevel` to ≤ 0 will only expose root properties.

::alert{type="warning"}

It is unlikely for `exposeLevel` to ever be over 4 - the usual depth of a Tailwind config. A higher value is also likely to increase boot-time and disk space in dev. Refer to the [Nuxt Virtual File System](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) to see generated files.

::

::alert{type="info"}

Named exports for properties below [root options](https://tailwindcss.com/docs/configuration#configuration-options) are prefixed with `_` (`_colors`, `_900`, `_2xl`) to ensure safe variable names. You can use default imports to provide any identifier or rename named imports using `as`. Properties with unsafe variable names (`spacing['1.5']`, `height['1/2']`, `keyframes.ping['75%, 100%']`) do not get exported individually.

::

## `injectPosition`

- Default: `'first'`
@@ -188,6 +161,7 @@ To disable the viewer during development, set its value to `false`:
export default {
tailwindcss: {
viewer: false
// viewer: { endpoint: '/_tailwind' }
}
}
```
34 changes: 25 additions & 9 deletions docs/content/2.tailwind/1.config.md
Original file line number Diff line number Diff line change
@@ -267,8 +267,7 @@ If you need resolved Tailwind config at runtime, you can enable the [exposeConfi
```js{}[nuxt.config]
export default {
tailwindcss: {
exposeConfig: true,
// exposeLevel: 1, // determines tree-shaking (optional)
exposeConfig: true
}
}
```
@@ -281,19 +280,36 @@ import tailwindConfig from '#tailwind-config'

// Import only part which is required to allow tree-shaking
import { theme } from '#tailwind-config'
```

Please be aware this adds `~19.5KB` (`~3.5KB`) to the client bundle size. If you want to only import _really_ specific parts of your tailwind config, you can enable imports for each property in the config:

```js{}[nuxt.config]
export default {
tailwindcss: {
exposeConfig: {
level: 4,
alias: '#twcss' // if you want to change alias
}
}
}
```

// Import within properties for further tree-shaking (based on exposeLevel)
import screens from '#tailwind-config/theme/screens' // default import
import { _neutral } from '#tailwind-config/theme/colors' // named (with _ prefix)
import { _800 as slate800 } from '#tailwind-config/theme/colors/slate' // alias
```js
// Import within properties for further tree-shaking
import screens from '#twcss/theme/screens' // default import
import { _neutral } from '#twcss/theme/colors' // named (with _ prefix)
import { _800 as slate800 } from '#twcss/theme/colors/slate' // alias
```

::alert{type="warning"}

Please be aware this adds `~19.5KB` (`~3.5KB`) to the client bundle size.
It is unlikely for `level` to ever be over 4 - the usual depth of a Tailwind config. A higher value is also likely to increase boot-time and disk space in dev. Refer to the [Nuxt Virtual File System](https://nuxt.com/docs/guide/directory-structure/nuxt#virtual-file-system) to see generated files.

::

::alert
Import types are only provided through the `#tailwind-config/*` alias.
::alert{type="info"}

Named exports for properties below [root options](https://tailwindcss.com/docs/configuration#configuration-options) are prefixed with `_` (`_colors`, `_900`, `_2xl`) to ensure safe variable names. You can use default imports to provide any identifier or rename named imports using `as`. Properties with unsafe variable names (`spacing['1.5']`, `height['1/2']`, `keyframes.ping['75%, 100%']`) do not get exported individually.

::
2 changes: 1 addition & 1 deletion docs/content/2.tailwind/2.viewer.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Visualize your Tailwind configuration with the viewer.

---

Nuxt Tailwind exposes a `/_tailwind/` route in development, allowing you to quickly visualize your Tailwind configuration with easy copy-pasting (thanks to the awesome [tailwind-config-viewer](https://github.com/rogden/tailwind-config-viewer) package ✨).
By default, the module will expose a `/_tailwind/` route in development, so that you can quickly visualize your Tailwind configuration with easy copy-pasting (thanks to the awesome [tailwind-config-viewer](https://github.com/rogden/tailwind-config-viewer) package ✨).

The viewer is available starting from version `v3.4.0` of `@nuxtjs/tailwindcss`.

2 changes: 1 addition & 1 deletion nuxt2-playground/package.json
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
"generate": "nuxt generate"
},
"dependencies": {
"nuxt": "2.17.1",
"nuxt": "2.17.2",
"postcss": "8.4.31"
},
"keywords": []
Loading