你正在瀏覽的是 Tailwind CSS v2. 的技術文件
Tailwind CSS 的 GitHub

Fill

Utilities for styling the fill of SVG elements.

Default class reference

Class
屬性
fill-currentfill: currentColor;

Usage

Use fill-current to set the fill color of an SVG to the current text color. This makes it easy to set an element’s fill color by combining this class with an existing text color utility.

Useful for styling icon sets like Zondicons that are drawn entirely with fills.

<svg class="fill-current text-green-600 ..."></svg>

Customizing

Control which fill utilities Tailwind generates by customizing the theme.fill section of your tailwind.config.js file:

  // tailwind.config.js
  module.exports = {
    theme: {
-     fill: {
-       current: 'currentColor',
-     }
+     fill: theme => ({
+       'red': theme('colors.red.500'),
+       'green': theme('colors.green.500'),
+       'blue': theme('colors.blue.500'),
+     })
    }
  }

Variants

默認情況下, 只有 響應式 的 fill 變化模式 (variants) 會產生。

tailwind.config.jsvariants 區塊中變更 fill 屬性來決定有哪些變化模式會生成。

舉個例子來說,這個設定將會生成 響應式 和 hover 的變化模式。

  // tailwind.config.js
  module.exports = {
    variants: {
      extend: {
        // ...
+       fill: ['responsive', 'hover'],
      }
    }
  }

Disabling

如果你不打算在專案中使用 fill 功能,可以在你的設定檔裡的 corePlugins 屬性中將 fill 設定為 false 來停用功能:

  // tailwind.config.js
  module.exports = {
    corePlugins: {
      // ...
+     fill: false,
    }
  }