简体   繁体   中英

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

i want customize width line "line-through" become more thick like 4-6px. i have customize thick line "line-through" on tailwind.config.js but it not works, maybe you can give me suggest about my problem.

 //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>

The correct css property is text-decoration-thickness so your plugin should be:

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

Here 'sa working version on Tailwind Play.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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