Tailwind CSS 任意值不适用于 Pug?

mra*_*e81 7 pug tailwind-css

v3.0.18我在 pug 文件中使用 Tailwind CSS 任意值时遇到问题。我遵循了这个答案,但它没有解决问题。

这是我的哈巴狗文件:

.container.mx-auto.flex.items-center.space-x-1
  .box.p-8.bg-yellow-800.text-white(class="w-1/2")
    h1.font-bold(class='text-2xl') It's normal
  .box.p-8.bg-yellow-800.text-white(class="w-[50%]")
    h1.font-bold(class='text-\[40px\]') It Doesn't Work
Run Code Online (Sandbox Code Playgroud)

那么,在 pug 中应用 Tailwind CSS 任意值的正确方法是什么?

小智 -1

您可以使用其他符号 - 在tailwind.config.js

module.exports = {
  separator: '_',
}
Run Code Online (Sandbox Code Playgroud)