Skip to content

Instantly share code, notes, and snippets.

@pbhj
Last active May 17, 2019 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbhj/6065ca4ad64fc71fdc2dfd98e322dd9a to your computer and use it in GitHub Desktop.
Save pbhj/6065ca4ad64fc71fdc2dfd98e322dd9a to your computer and use it in GitHub Desktop.
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
Copy link
Author

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