Skip to content

Instantly share code, notes, and snippets.

@seandrickson
Last active December 20, 2015 06:18
Show Gist options
  • Save seandrickson/6084596 to your computer and use it in GitHub Desktop.
Save seandrickson/6084596 to your computer and use it in GitHub Desktop.
A userstyle to Hacker News (http://news.ycombinator.com) which tries to keep the feel of the original but with better readability. Specifically, it sets a max-width and better font sizes.
html {
-webkit-box-sizing: border-box;
box-sizing: border-box;
font-family: Verdana, sans-serif;
font-size: 16px;
line-height: 1.5;
}
*,
*:before,
*:after {
-webkit-box-sizing: inherit;
box-sizing: inherit;
}
body {
margin: 0 auto;
max-width: 50em;
}
body,
td,
input,
textarea,
.default,
.title,
.pagetop {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
textarea {
width: 100%;
resize: vertical;
}
pre {
max-width: 37.5em;
overflow: auto;
padding: .13em;
}
table {
width: 100%;
border-collapse: collapse;
}
tr[style~='height:10px'] {
height: 1em;
}
tr[style~='height:5px'] {
height: 1.5em;
}
td {
padding: .125em .25em;
}
.admin td {
font-size: .75em;
}
.adtitle,
.dead,
.comment {
font-size: .9em;
}
.default p {
margin-top: 0;
margin-bottom: .7em;
}
.subtext td,
.yclinks,
.comhead {
font-size: .6em;
}
@seandrickson
Copy link
Author

Moving away from pixels and declaring defaults on HTML and extending them to other elements via inherit. It makes it easy to override if need be.

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