Stroke Width v1.2.0+
Class reference
Usage
Use the .stroke-{width} utilities to set the stroke width of an SVG.
Useful for styling icon sets like Feather that are drawn entirely with strokes.
<svg class="stroke-current stroke-1 text-green-500 ..."></svg>
<svg class="stroke-current stroke-2 text-green-500 ..."></svg>
Responsive
To control the stroke width of an SVG element at a specific breakpoint, add a {screen}: prefix to any existing width utility. For example, adding the class md:stroke-2 to an element would apply the stroke-2 utility at medium screen sizes and above.
For more information about Tailwind's responsive design features, check out the Responsive Design documentation.
Customizing
Control which stroke-width utilities Tailwind generates by customizing the theme.strokeWidth section in your tailwind.config.js file:
Learn more about customizing the default theme in the theme customization documentation.
Responsive and pseudo-class variants
By default, only responsive variants are generated for stroke-width utilities.
You can control which variants are generated for the stroke-width utilities by modifying the strokeWidth property in the variants section of your tailwind.config.js file.
For example, this config will also generate hover and focus variants:
Disabling
If you don't plan to use the stroke-width utilities in your project, you can disable them entirely by setting the strokeWidth property to false in the corePlugins section of your config file: