通过 100+ 技巧集合学习 Nuxt!

emotion
@nuxtjs/emotion

Nuxt 的下一代 CSS-in-JS

emotion

@nuxtjs/emotion

npm version npm downloads circle ci coverage License

Emotion module for Nuxt.js

特性

  • 服务端渲染 (SSR)
  • 带有 Hydration 的关键路径 CSS
  • 热重载 (HMR)
  • 样式内联
  • 压缩
  • 死代码消除
  • 源代码地图
  • 上下文类名

📖 发布说明

安装

  1. 添加 @nuxtjs/emotion 依赖到你的项目
yarn add @nuxtjs/emotion # or npm install @nuxtjs/emotion
  1. 添加 @nuxtjs/emotionnuxt.config.jsmodules 部分
export default {
  modules: [
    '@nuxtjs/emotion',
  ]
}

Nuxt 2

Nuxt 2 通过 @nuxtjs/emotion@0.1.0 支持,文档位于 https://github.com/nuxt-community/emotion-module/tree/v0,代码位于 v0 分支。

开发

  • 克隆此仓库
  • 使用 yarn installnpm install 安装依赖
  • 使用 npm run dev 启动开发服务器

许可证

MIT 许可证

版权所有 (c) Nuxt Community