SVG
用于设置 SVG 元素描边宽度的功能类。
| Class | Styles |
|---|---|
stroke-<number> | stroke-width: <number>; |
stroke-(length:<custom-property>) | stroke-width: var(<custom-property>); |
stroke-[<value>] | stroke-width: <value>; |
使用 stroke-<number> 功能类(如 stroke-1 和 stroke-2)来设置 SVG 的描边宽度:
<svg class="stroke-1 ..."></svg><svg class="stroke-2 ..."></svg>这对于设置 Heroicons 等图标集的样式非常有用。
Use the stroke-[<value>] syntax to set the 描边宽度 based on a completely custom value:
<div class="stroke-[1.5] ..."> <!-- ... --></div>For CSS variables, you can also use the stroke-(length:<custom-property>) syntax:
<div class="stroke-(length:--my-stroke-width) ..."> <!-- ... --></div>This is just a shorthand for stroke-[length:var(<custom-property>)] that adds the var() function for you automatically.
Prefix a stroke-width utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:
<div class="stroke-1 md:stroke-2 ..."> <!-- ... --></div>Learn more about using variants in the variants documentation.