Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
modify date format on stackoverflow and stackexchange sites using userContent.css for Firefox
/*
* 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;
}
}
@pbhj

This comment has been minimized.

Copy link
Owner Author

@pbhj pbhj commented May 16, 2019

If you make improvements please post them back in a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment