nuxt-community / emotion-module

πŸ’– Emotion module for Nuxt.js

Home Page:https://emotion.sh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

emotion

@nuxtjs/emotion

npm version npm downloads circle ci coverage License

Emotion module for Nuxt.js

Features

  • Server Side Rendering (SSR)
  • Critical Path CSS with Hydration
  • Hot Reloads (HMR)
  • Style inlining
  • Minification
  • Dead Code Elimination
  • Source Maps
  • Contextual Class Names

πŸ“– Release Notes

Setup

IMPORTANT NOTE: This module requires new hooks that works with nuxt 2.5.0 or nuxt-edge only.

  1. Add @nuxtjs/emotion dependency to your project
yarn add @nuxtjs/emotion # or npm install @nuxtjs/emotion
  1. Add @nuxtjs/emotion to the modules section of nuxt.config.js
export default {
  modules: [
    // Simple usage
    '@nuxtjs/emotion',

    // With options
    ['@nuxtjs/emotion', { /* module options */ }]
  ]
}

Using top level options

export default {
  modules: [
    '@nuxtjs/emotion'
  ],
  emotion: {
    /* module options */
  }
}

Options

ssr

  • Default: 'critical'

Can be 'critical' or 'render' or false.

In the critical mode, module automatically injects window.$emotionSSRIds for hydration.

babel

  • Default: { inline: true }

Options for babel-plugin-emotion integration.

Can be disabled by setting to false.

Development

  • Clone this repository
  • Install dependencies using yarn install or npm install
  • Start development server using npm run dev

License

MIT License

Copyright (c) Nuxt Community

About

πŸ’– Emotion module for Nuxt.js

https://emotion.sh

License:MIT License


Languages

Language:TypeScript 40.6%Language:JavaScript 36.9%Language:Vue 22.5%