Home
Softono
nuxt-beastcss

nuxt-beastcss

Open source MIT TypeScript
35
Stars
4
Forks
2
Issues
2
Watchers
3 years
Last Commit

About nuxt-beastcss

<!-- Get your module up and running quickly. Find and replace all on all files (CMD+SHIFT+F): - Name: Nuxt Beastcss - Package name: nuxt-beastcss - Description: Fast Critical CSS for Nuxt --> # Nuxt Beastcss Module [![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 - [✨ &nbsp;Release Notes](/CHANGELOG.md) <!-- - [πŸ“– &nbsp;Documentation](https://example.com) --> ## ⭐️ Features <!-- Highlight some of the features your module provide here --> - πŸ§™ &nbsp;Zero-configuration required - 🧬 &nbsp;Auto Enables Nuxt CSS Extraction - πŸ“ &nbsp;Inject critical CSS automatically to page html - 🧼 &nbsp;Removes injected CSS from main files - ⚑️ &nbsp;Lightning fast - 🎭️ &nbsp;Working both in ssr and generate mode - πŸ‘― &nbsp;Both __Nuxt 3__ and __Nuxt 2__ supported. ## πŸ“¦ Quick Setup 1. Add `nuxt-beastcss` dependency to your project ```bash # Using pnp ...

Platforms

Web Self-hosted

Languages

TypeScript

Links

Nuxt Beastcss Module

npm version npm downloads License Nuxt

Fast Critical CSS for Nuxt

⭐️ Features

  • πŸ§™  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.

πŸ“¦ Quick Setup

  1. Add nuxt-beastcss dependency to your project
# Using pnpm
pnpm add -D nuxt-beastcss

# Using yarn
yarn add --dev nuxt-beastcss

# Using npm
npm install --save-dev nuxt-beastcss
  1. Add nuxt-beastcss to the modules section of nuxt.config.ts
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:

// 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

# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Fix style
npm run lint:fix

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

πŸ‘ Thanks

Thanks to @freddy38510 for his work on beastcss and thanks to @leeoniya for dropcss the magic behind HTML parsing speed.