首页 > 解决方案 > 如何在“createGlobalStyle”中导入顺风

问题描述

我正在尝试在我的样式化组件 globalstyle 中导入 tailwind,以设置基本样式。

下面的代码不起作用,那么关于如何使它起作用的任何建议?

import {createGlobalStyle} from 'styled-components';


const GlobalStyle = createGlobalStyle`
  @tailwind base;
  @tailwind components;
  @tailwind utilities;
  
  @layer base {
    h1 {
      @apply text-2xl;
    }
    h2 {
      @apply text-xl;
    }
  }
`

标签: next.jsstyled-componentstailwind-csstailwind-in-js

解决方案


推荐阅读