2.6.1 ā€¢ Published 1 year ago

nuxt-windicss v2.6.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

nuxt-windicss

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
  • šŸ“„ Use @apply / @screen directives in any file: Vue SFC, Less, SCSS, SASS, PostCSS, Stylus
  • šŸŽ³ Support Utility Groups - e.g. bg-gray-200 hover:(bg-gray-100 text-red-300)
  • šŸ§‘ā€šŸ¤ā€šŸ§‘ Compatible with nuxt-vite

Install

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

Usage

Within your nuxt.config.js add the following.

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

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

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

If you have a tailwind.config.js, please rename it to windi.config.js or windi.config.ts.

See here for configuration details.

Migrating

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

Configuration

  • Default:
export default {
  // ...
  windicss: {
    scan: {
      dirs: ['./'],
      exclude: [
        'node_modules',
        '.git',
        '.github',
        '.nuxt/**/*'
      ],
    },
    preflight: {
      alias: {
        // add nuxt aliases
        'nuxt-link': 'a',
        // @nuxt/image module
        'nuxt-img': 'img',
      },
    },
  }
}

Examples

Disable Preflight

nuxt.config.js

export default {
  // ...
  windicss: {
    preflight: false
  },
}  

Scan classes from a node_modules package

Out-of-the-box this module ignores any files in node_modules, this is to simplify the scanning for the majority for users.

To opt-in to this scanning you will need to setup the scan options yourself.

nuxt.config.js

export default {
  // ...
  hooks: {
    windicss: {
      options(options) {
        options.scanOptions.exclude = [ '.git', '.github', '.nuxt/**/*' ]
        options.scanOptions.dirs = [
          './node_modules/vue-tailwind-color-picker/src',
          './components',
          './pages',
          './layouts',
        ]
        return options
      }
    }
  }
}

Hooks

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

windicss:config

  • Arguments: FullConfig

Modify the Windi CSS configuration before it is passed to the webpack plugin.

Useful for making runtime style changes.

windicss:options

  • Arguments: options

Modify the Windi CSS options before they are passed to the webpack plugin.

Useful for adding runtime directories to the scan path.

Credits

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

License

MIT License Ā© 2021 Harlan Wilton

2.6.1

1 year ago

2.5.5

1 year ago

2.6.0

1 year ago

2.5.4

1 year ago

2.5.3

1 year ago

2.5.2

2 years ago

2.5.1

2 years ago

2.4.1

2 years ago

2.4.0

2 years ago

2.4.3

2 years ago

2.4.2

2 years ago

2.3.2

2 years ago

2.5.0

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.2.11

2 years ago

2.2.10

2 years ago

2.2.9

2 years ago

2.2.7

2 years ago

2.2.8

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.2.3

2 years ago

2.2.2

2 years ago

2.2.5

2 years ago

2.2.4

2 years ago

2.2.6

2 years ago

2.1.2

2 years ago

2.0.15

2 years ago

2.1.1

2 years ago

2.0.13

2 years ago

2.0.14

2 years ago

2.1.0

2 years ago

2.0.12

2 years ago

2.0.7

3 years ago

2.0.6

3 years ago

2.0.9

3 years ago

2.0.8

3 years ago

2.0.11

3 years ago

2.0.10

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

1.2.5

3 years ago

2.0.3

3 years ago

2.0.0-6

3 years ago

2.0.2

3 years ago

2.0.0-5

3 years ago

2.0.0-4

3 years ago

2.0.0-3

3 years ago

2.0.0-2

3 years ago

2.0.0-1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

2.0.0-7

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.3

3 years ago

1.0.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.7.5

3 years ago

0.8.0-3

3 years ago

0.8.0-2

3 years ago

0.8.0-1

3 years ago

0.8.0-0

3 years ago

0.8.1

3 years ago

0.7.2

3 years ago

0.8.0

3 years ago

0.7.1

3 years ago

0.7.4

3 years ago

0.7.3

3 years ago

0.7.0

3 years ago

0.6.0

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.10

3 years ago

0.4.11

3 years ago

0.4.9

3 years ago

0.4.8

3 years ago

0.4.7

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.6

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.0

3 years ago