用于设置 SVG 元素线条厚度(Stroke Width)的功能类。
<svg class="stroke-current stroke-1 text-green-600 ..."></svg>
<svg class="stroke-current stroke-2 text-green-600 ..."></svg>要在特定的断点处控制 SVG 元素的 stroke width,可以在任何现有的宽度功能类中添加 {screen}: 前缀。例如,添加类 md:stroke-2 到一个元素中,就会在中等屏幕尺寸及以上时应用 stroke-2 功能类。
<svg class="stroke-1 md:stroke-2 ...">
  <!-- ... -->
</svg>关于 Tailwind 的响应式设计功能的更多信息,请查看响应式设计文档。
通过在您的 tailwind.config.js 文件中自定义 theme.strokeWidth 部分来控制 Tailwind 产生的线条宽度。
  // tailwind.config.js
  module.exports = {
    theme: {
      extend: {
        strokeWidth: {
+         '3': '3',
+         '4': '4',
        }
      }
    }
  }在定制主题文档中了解更多关于定制默认主题的信息。
默认情况下, 针对 stroke-width 功能类,只生成 responsive 变体。
您可以通过修改您的 tailwind.config.js 文件中的 variants 部分中的 strokeWidth 属性来控制为 stroke-width 功能生成哪些变体。
例如,这个配置也将生成 hover and focus 变体:
  // tailwind.config.js
  module.exports = {
    variants: {
      extend: {
        // ...
+       strokeWidth: ['hover', 'focus'],
      }
    }
  }如果您不打算在您的项目中使用 stroke-width 功能,您可以通过在配置文件的 corePlugins 部分将 strokeWidth property to false in the corePlugins section of your config file:
  // tailwind.config.js
  module.exports = {
    corePlugins: {
      // ...
+     strokeWidth: false,
    }
  }