【问题标题】:TAILWIND | How to rewrite custom tailwind class尾风 |如何重写自定义顺风类
【发布时间】:2022-01-28 19:52:58
【问题描述】:

如果需要,我想重写我的 .title 类元素。

.title {
    @apply text-[60px] leading-[64px] font-black text-white;
}

<div class='title text-red-300'> <==== how can I change text color to be red and not white?

【问题讨论】:

    标签: tailwind-css


    【解决方案1】:

    把它放在components 层里面。 DEMO

    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    
    @layer components {
      .title {
        @apply text-[60px] leading-[64px] font-black text-white;
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2021-09-08
      • 2021-11-21
      • 1970-01-01
      • 2020-11-25
      • 2020-12-04
      • 2022-01-15
      • 2023-01-17
      • 2021-07-28
      • 2021-10-14
      相关资源
      最近更新 更多