Fast Critical CSS for Nuxt
npm install nuxt-beastcss
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]
[![Nuxt][nuxt-src]][nuxt-href]
> Fast Critical CSS for Nuxt
- ๐ง Zero-configuration required
- ๐งฌ Auto Enables Nuxt CSS Extraction
- ๐ Inject critical CSS automatically to page html
- ๐งผ Removes injected CSS from main files
- โก๏ธ Lightning fast
- ๐ญ๏ธ Working both in ssr and generate mode
- ๐ฏ Both __Nuxt 3__ and __Nuxt 2__ supported.
1. Add nuxt-beastcss dependency to your project
``bashUsing pnpm
pnpm add -D nuxt-beastcss
2. Add
nuxt-beastcss to the modules section of nuxt.config.ts`js
export default defineNuxtConfig({
modules: [
'nuxt-beastcss'
]
})
`That's it! You can now use Nuxt Beastcss in your Nuxt app โจ
๐จ Options
You can write the
nuxt-beastcss config like this:`js
// nuxt.config.js
import { defineNuxtConfig } from 'nuxt'
export default defineNuxtConfig({
modules: ['nuxt-beastcss'],
beastcss: {
// Options passed directly to beastcss: https://github.com/freddy38510/beastcss/tree/master/packages/beastcss#options
config: {
// Default: false
fontFace: true,
},
},
})
`In the
config object you can pass all beastcss-official-options.๐ป Development
`bash
Install dependencies
npm installGenerate type stubs
npm run dev:prepareDevelop with the playground
npm run devBuild the playground
npm run dev:buildRun ESLint
npm run lintFix style
npm run lint:fixRun Vitest
npm run test
npm run test:watchRelease new version
npm run release
``Thanks to @freddy38510 for his work on beastcss and thanks to @leeoniya for dropcss the magic behind HTML parsing speed.
[npm-version-src]: https://img.shields.io/npm/v/nuxt-beastcss/latest.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-version-href]: https://npmjs.com/package/nuxt-beastcss
[npm-downloads-src]: https://img.shields.io/npm/dm/nuxt-beastcss.svg?style=flat&colorA=18181B&colorB=28CF8D
[npm-downloads-href]: https://npmjs.com/package/nuxt-beastcss
[license-src]: https://img.shields.io/npm/l/nuxt-beastcss.svg?style=flat&colorA=18181B&colorB=28CF8D
[license-href]: ./LICENSE
[nuxt-src]: https://img.shields.io/badge/Nuxt-18181B?logo=nuxt.js
[nuxt-href]: https://nuxt.com