W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
用于設(shè)置 SVG 元素填充(fill)樣式的功能類。
Class
|
Properties
|
---|---|
fill-current | fill: currentColor; |
使用 ?fill-current
? 將 SVG 的填充色設(shè)置為當(dāng)前的文本顏色。通過將該類與現(xiàn)有的文本顏色功能類相結(jié)合,可以輕松設(shè)置元素的填充顏色。
對(duì)于像 Zondicons 這樣完全用填充色繪制的圖標(biāo)集來說是很有用的:
通過自定義您的 ?tailwind.config.js
? 文件的 ?theme.fill
? 部分來控制 Tailwind 生成哪些 ?fill
?功能類。
// 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'),
})
}
}
默認(rèn)情況下, 針對(duì) fill 功能類,只生成 responsive 變體。
您可以通過修改您的 ?tailwind.config.js
? 文件中的 ?variants
?部分中的 ?fill
?屬性來控制為 fill 功能生成哪些變體。
例如,這個(gè)配置也將生成 hover and focus 變體:
// tailwind.config.js
module.exports = {
variants: {
extend: {
// ...
fill: ['hover', 'focus'],
}
}
}
如果您不打算在您的項(xiàng)目中使用 fill 功能,您可以通過在配置文件的 ?corePlugins
?部分將 ?fill
?屬性設(shè)置為 ?false
?來完全禁用它們:
// tailwind.config.js
module.exports = {
corePlugins: {
// ...
fill: false,
}
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: