【问题标题】:tailwind@1.9.6 how to use extracted component with prefix for responsive?tailwind@1.9.6 如何使用提取的带有前缀的组件进行响应?
【发布时间】:2021-03-18 16:32:52
【问题描述】:

我是初学网页设计师,使用 windows10。

我正在使用顺风(1.9.6 版)

我想在 css 文件中使用 @apply 提取的组件使用前缀(例如 sm 和 md ),如下所示。 css

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

@layer components {
 .itemcase {
        @apply border border-gray300 text-sm font-semibold
    }
}

我认为下面的代码可以工作,但没有工作。

@layer components {
 .itemcase:sm {
        @apply border border-gray300 text-lg font-bold
    }
}

我该如何解决这个问题?

我阅读了似乎与此问题相关的文档(https://tailwindcss.com/docs/functions-and-directives),但无法找到解决方案。 请帮帮我...

【问题讨论】:

    标签: components apply responsive prefix tailwind-css


    【解决方案1】:
    @tailwind base;
    @tailwind components;
    @tailwind utilities;
    
    @layer base {
     .itemcase {
            @apply border border-gray-300 text-sm font-semibold
        }
    }
    

    也许它有效。 ?

    【讨论】:

      猜你喜欢
      • 2020-05-18
      • 1970-01-01
      • 2017-07-20
      • 1970-01-01
      • 1970-01-01
      • 2014-09-10
      • 1970-01-01
      • 1970-01-01
      • 2016-06-12
      相关资源
      最近更新 更多