by deleerium · 6y ago · 0 comments
Whipped this up real quick... keeps the spirit of HN I think, and is pretty minimal. Not my best CSS but tables/current CSS make some selectors a little tricky and after all, it's less than 1kb added, no markup or stack changes needed, and this is 'Hacker News' right? :D
@media (prefers-color-scheme: dark) { body { background-color: #1F2430; }
#hnmain { background-color: #232834; }
a:link.storylink,
#hnmain > tbody > tr:first-child > td a,
.commtext, .commtext a:link,
td {
color: #fafafa;
}
#hnmain > tbody > tr:first-child > td { background-color: #333a4a; }
a:link,
.sitebit, .subtext, .sitestr, .subtext a:link,
.rank, a.morelink,
.pagetop, .yclinks a,
.comhead a:link, .comhead,
.hnmore a:link, .reply a:link {
color: #8c96ac;
}
a:visited {
color: #979cf4;
}
.votearrow {
overflow: visible;
position: relative;
}
.votearrow::before {
content: "";
width: 0;
height: 0;
left: 1px;
top: 3px;
display: block;
position: absolute;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 7px solid #bebfd1;
}
input[type=text],
textarea {
background-color: #333a4a;
color: #fafafa;
border: 1px solid #1F2430;
}
}Edit: missed a few on other pages! Added arrow CSS patch, added screenshot from imgur, added text input colors for profile and replies.
Screenshot: https://imgur.com/a/XW1OCYb
@media (prefers-color-scheme: dark) { body { background-color: #232834; }
#hnmain { background-color: #1F2430; }
a:link.storylink,
#hnmain > tbody > tr:first-child > td a,
.commtext, .commtext a:link,
td {
color: #fafafa;
}
#hnmain > tbody > tr:first-child > td { background-color: #4a3226; }
a:link,
.sitebit, .subtext, .sitestr, .subtext a:link,
.rank, a.morelink,
.yclinks a,
.comhead a:link, .comhead,
.hnmore a:link, .reply a:link {
color: #8c96ac;
}
.pagetop { color: #795848; }
a:visited {
color: #979cf4;
}
.votearrow {
overflow: visible;
position: relative;
}
.votearrow::before {
content: "";
width: 0;
height: 0;
left: 1px;
top: 3px;
display: block;
position: absolute;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-bottom: 7px solid #bebfd1;
}
}edit: fixed imgur link and added full css
I've added this code to fix the reply textarea colour:
.fatitem textarea { background-color: #232834; color: #fafafa; }
:root,
html {
background-color: white;
filter: invert(100%);
}
* {
background-color: inherit;
}I have this as a bookmark and work well in many cases.
For those of you asking, feel free to do whatever you want with this CSS ^_^
https://gist.github.com/deleerium/ca6ddeed5dc07a81f764a83ecd...
Most HN threads linking to a site that has light-grey-on-dark-grey or dark-grey-on-light-grey text have at least one (off-topic) complaint about site style. Let's not make HN one of those sites.
I guess everyone's mileages vary depending on their eyesight, my eye's are 53 years old now and aren't as spritely as they used to be.
This is something I don't like about VS Code. by being low contrast it means I have to turn up monitor contrast meaning everything else burns.
> Let's not make HN one of those sites.
The OP of the thread you are replying to is #828282 on top of #f6f6ef. That is lower contrast than black on white.
[1]: https://www.theregister.co.uk/2019/07/10/firefox_68_arrives_...
Maybe try to swap the #fafafa rule with #eaeaea? Does that feel better? It's still very high contrast so maybe that could be a happy medium.
to preview, folks can live edit this page in inspector and paste these styles into a style tag.
in firefox, F12 to open inspector, hit '+' in the style pane to insert a <style> tag (but don't add a rule), then right click the inserted tag in the inspector pane and "edit as html" to edit the html, and finally paste these styles inside the tag and click out of it.
Can I create stylus theme out of this share it?
I want to try out the different styles in the comments, but I'm hesitant to upvote until I see for myself what it looks like.