Stroke Width
v1.2.0+
Utilities for styling the stroke width of SVG elements.
Use the utilities to set the stroke width of an SVG.
Useful for styling icon sets like Feather that are drawn entirely with strokes.
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 documentation.
all
sm
md
lg
xl
Control which stroke-width utilities Tailwind generates by customizing the section in your tailwind.config.js
file:
Learn more about customizing the default theme in the theme customization documentation.
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 file.
For example, this config will also generate hover and focus variants: