※ veridical.net
  • About
  • Publications
  • 3 Questions
  • Top N
  • Tags
  • Archives

Simpler Strike Out

I’ve had my own Dr. Drang moment, which is when you describe how you’ve done something and then someone shows a better way.

In my case it was collegue and most-excellent person Chris Radcliff responding to Implementing Strike Out:

Haha, I had not, but this seems way better. Mark’s default seems closer to what I want, but semantically ins and del are closer so I’ll probably use those and fix the default styling in CSS. I love deleting code, thanks!

— Adam Wuerl (@wuerl) December 29, 2020

So this is a little meta, even for me, but here’s what I’ve now changed. First, I simplified the CSS, replacing span.new with ins and span.strike with del. I was also able to remove display: inline-block; from both definitions but had to add text-decoration: none; to ins because I don’t want new text underlined, which is the default. Here’s the result:

.article-content ins {
    text-decoration: none;
    background-color: #b3e8b4;
}
.article-content del {
    text-decoration: line-through;
    background-color: #f2c2bf;
}

Which means to generate this: new text to be added, I can write <ins>new text to be added</ins> instead of <span class="new">new text to be added</span>.


  • « An Updated Favicon
  • The Most Useful Idea in Economics »

Published

Dec 29, 2020

by Adam Wuerl

Tags

  • automation 3
  • meta 7

Contact

Twitter
RSS
Mastodon
LinkedIn
Stack Exchange
Micro.blog
  • Powered by Pelican. Theme: Elegant by Talha Mansoor