0.2.3 ā€¢ Published 4 years ago

nuxt-windicss-module v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

nuxt-windicss-module

Features

  • āš”ļø It's FAST - 20~100x times faster than @nuxtjs/tailwindcss
  • šŸ§© On-demand CSS utilities (Compatible with Tailwind CSS v2) and native elements style resetting
  • šŸƒ Load configurations from tailwind.config.js
  • šŸ“„ CSS @apply / @screen directives transforms
  • šŸŽ³ Support Utility Groups - e.g. bg-gray-200 hover:(bg-gray-100 text-red-300)
  • šŸ§‘ā€šŸ¤ā€šŸ§‘ Compatible with nuxt-vite

Install

yarn add nuxt-windicss-module -D
# npm i nuxt-windicss-module -D

:warning: This module is a pre-release, please report any issues you find.

Usage

Within your nuxt.config.js add the following.

// nuxt.config.js
buildModules: [
  'nuxt-windicss-module',
],

This module won't work with @nuxtjs/tailwindcss, you will need to remove it.

buildModules: [
-  '@nuxtjs/tailwindcss',
],

This module will read from your root tailwind.config.js or windi.config.js config if present. See here for details.

Migrating

If you were previously using @nuxtjs/tailwindcss, please consult the documentation on migrating.

Configuration

  • Default:
windicss: {
  scan: {
    dirs: ['./'],
      exclude: ['.nuxt/**/*']
  },
  transformCSS: 'pre',
  preflight: {
    alias: {
      // add nuxt aliases
      'nuxt-link': 'a',
    }
  }
}

Hooks

You can use the following nuxt hooks to modify the behaviour of the code.

windicss:config

  • Arguments: options

Modify the windicss configuration before it is passed to the webpack plugin.

Caveats

Scoped Style

@media directive with scoped style can only work with css postcss scss but not sass, less nor stylus

Credits

  • Windy team
  • @antfu Based on his Rollup / Vite implementation & his util package

License

MIT License Ā© 2021 Harlan Wilton

0.1.10

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.2.1

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.2.3

4 years ago

0.1.4

4 years ago

0.2.2

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.0

4 years ago