繁体   English   中英

如何自定义颜色顺风css上的横穿文字装饰

[英]How to customize color The line-through text decoration on tailwind css

我想自定义宽度线“line-through”变得更粗,如 4-6px。 我在tailwind.config.js 上自定义了粗线“line-through”,但它不起作用,也许你可以就我的问题给我建议。

 //setting tailwind.config.js in plugin:[] function ({addUtilities}) { const extendLineThrough = { '.line-through': { 'textDecoration': 'line-through', 'text-decoration-color': 'red', 'text-decoration-width': '4px' }, } addUtilities(extendLineThrough) }
 <div class="hidden sm:block md:col-span-2 text-rigt"> <p class="md:pt-1 text-gray-500 line-through"> Rp. 8000 </p> </div>

正确的 css 属性是text-decoration-thickness所以你的插件应该是:

function ({addUtilities}) {
  const extendLineThrough = {
      '.line-through': {
          'textDecoration': 'line-through',
          'text-decoration-color': 'red',
          'text-decoration-thickness': '4px'
      },
  }
  addUtilities(extendLineThrough)
}

是 Tailwind Play 上的工作版本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM