【问题标题】:What is base in tailwind config used for?顺风配置中的基础用于什么?
【发布时间】:2021-10-30 00:56:31
【问题描述】:

我想知道在tailwind 配置文件中可以配置什么,我只是不明白可以在这个文件中配置什么,特别是基础部分。

@tailwind base;

@tailwind components;

@tailwind utilities;

谁能详细说明一下?

【问题讨论】:

  • @tailwind base;:需要的基本 css。例如:m-full -> 全边距。
  • 对不起,我不明白。

标签: tailwind-css


【解决方案1】:

使用@tailwind 表示插入 Tailwind 的指令。 Tailwind 支持将这四个指令 basecomponentsutilitiesscreens 样式添加到您的 CSS 中。

Base 注入 Tailwind 的基本样式,例如插入任何布局 主题等。详细使用base

@layer base {
  h1 {
    @apply text-2xl;
  }
  h2 {
    @apply text-xl;
  }
}

同样,组件也可以提取一些类,比如按钮。 您可以通过所有这些来获取hints

【讨论】:

    猜你喜欢
    • 2021-05-23
    • 2021-05-30
    • 2022-01-16
    • 1970-01-01
    • 1970-01-01
    • 2021-02-24
    • 2013-01-01
    • 1970-01-01
    • 2012-11-19
    相关资源
    最近更新 更多