Fill
@include('_partials.class-table', [ 'rows' => [ [ '.fill-current', 'fill: currentColor;', 'Set the fill color to the current text color.', ], ] ])
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.
@component('_partials.code-sample', ['class' => 'text-center'])
@endcomponentCustomizing
Control which fill utilities Tailwind generates by customizing the theme.fill
section of your tailwind.config.js
file:
@component('_partials.customized-config', ['key' => 'theme'])
- fill: {
- current: 'currentColor',
- }
- fill: theme => ({
- 'red': theme('colors.red.500'),
- 'green': theme('colors.green.500'),
- 'blue': theme('colors.blue.500'),
- }) @endcomponent
@include('_partials.variants-and-disabling', [ 'utility' => [ 'name' => 'fill', 'property' => 'fill', ], 'variants' => ['responsive'], ])