tailwind 应用在 tailwind 版本 3 中不起作用

问题描述 投票:0回答:1
html css tailwind-css tailwind-3
1个回答
0
投票

您需要使用 tailwind @layer 指令才能使 @apply 类正常工作。

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {

  .hamburger-line {
    @apply w-[30px] h-[2px] my-2 block bg-black;
  }

  .hamburger-active > span:nth-child(1) {
    @apply origin-top-left rotate-45;
  }

  .hamburger-active > span:nth-child(3) {
    @apply origin-bottom-left -rotate-45;
  }

}
© www.soinside.com 2019 - 2024. All rights reserved.