您需要使用 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;
}
}