/* * Please share improvements here or on StackOverflow and add a link here. * Please upvote https://meta.stackoverflow.com/questions/288674/custom-date-format/385090#385090 if you agree that * users should have a choice of date format available. * * - see https://developer.mozilla.org/en-US/docs/Web/CSS/@document * - https://www.regextester.com/ may be useful too, but careful of the double escaping! * keywords: date format, date display, stackoverflow, stackexchange, css, script */ /* this doesn't work -> @-moz-document domain(stackoverflow.com) domain(stackexchange.com) */ @-moz-document regexp('.*(askubuntu|stackoverflow|stackexchange)\\.com/?.*') { span.relativetime { overflow: hidden; color:#fff; } span.relativetime::before { color:#333; content: attr(title) ' '; width: 50%; display:inline-block; height:1.1em; overflow: hidden; white-space: pre-wrap; } span.relativetime-clean { color:#fff; } span.relativetime-clean::before { color:#333; font-weight: bold; content: ' ' attr(title) ' '; display:inline-block; } }