Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ==========================================================
- HACKER NEWS – LAYERED DARK THEME
- Editorial + Modern UI Edition
- ========================================================== */
- /* ==========================================================
- 1. DENSITY TOGGLE
- ========================================================== */
- :root {
- --hn-density: 0;
- }
- /* ==========================================================
- 2. DESIGN TOKENS
- ========================================================== */
- :root {
- --bg-main: #111111;
- --bg-card-1: #1a1a1a;
- --bg-card-2: #1f1f1f;
- --bg-comment: #1e1e1e;
- --bg-chip: #222222;
- --bg-chip-hover: #2a2a2a;
- --text-primary: #e0e0e0;
- --text-muted: #b3b3b3;
- --text-rank: #9aa0a6;
- --accent-blue: #5aa9ff;
- --accent-blue-hover: #cfe3ff;
- --accent-orange: #ff7849;
- --radius-card: 10px;
- --radius-small: 6px;
- /* ======================================================
- FONT STACKS (CSP SAFE)
- ====================================================== */
- /* UI font (Inter-like system stack) */
- --font-ui: 'IBM Plex Sans', 'Segoe UI', Bahnschrift, system-ui, sans-serif;
- /* Reading font (bookish serif stack) */
- --font-reading: 'Spectral', 'Palatino Linotype', Georgia, serif;
- --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
- /* ======================================================
- SPACING SYSTEM
- ====================================================== */
- --story-padding-y: calc(16px - (8px * var(--hn-density)));
- --story-padding-x: calc(18px - (6px * var(--hn-density)));
- --story-margin: calc(14px - (8px * var(--hn-density)));
- --comment-padding: calc(10px - (4px * var(--hn-density)));
- --title-padding-y: calc(6px - (2px * var(--hn-density)));
- --title-padding-x: calc(10px - (2px * var(--hn-density)));
- }
- /* ==========================================================
- 3. GLOBAL BASE
- ========================================================== */
- html,
- body {
- background-color: var(--bg-main);
- color: var(--text-primary);
- font-family: var(--font-ui);
- font-size: 16px;
- line-height: 1.45;
- -webkit-font-smoothing: antialiased;
- text-rendering: optimizeLegibility;
- letter-spacing: 0.01em;
- font-feature-settings: 'liga', 'kern', 'calt';
- }
- /* ==========================================================
- Layout
- ========================================================== */
- #hnmain {
- background-color: transparent;
- width: 85%;
- margin: auto;
- padding: 12px;
- }
- #hnmain td {
- background-color: transparent;
- border: none;
- }
- /* ==========================================================
- 4. LINKS
- ========================================================== */
- a,
- .comment a,
- .subtext a,
- .comhead a {
- color: var(--accent-blue) !important;
- text-decoration: underline;
- text-decoration-thickness: 1px;
- text-underline-offset: 3px;
- text-decoration-color: transparent;
- transition:
- color 0.18s ease,
- text-decoration-color 0.18s ease;
- }
- a:hover,
- .comment a:hover,
- .subtext a:hover,
- .comhead a:hover {
- color: #ffffff !important;
- text-decoration-color: currentColor;
- }
- a:visited {
- color: #9ecbff !important;
- }
- /* ==========================================================
- Fix Reply Link Double Underline
- ========================================================== */
- .reply u {
- text-decoration: none;
- }
- .reply a {
- text-decoration: underline !important;
- text-decoration-thickness: 1px;
- text-underline-offset: 3px;
- }
- /* ==========================================================
- 5. HEADER – Full Editorial Refinement
- ========================================================== */
- /* Masthead container */
- .pagetop {
- display: flex;
- flex-wrap: wrap;
- align-items: baseline;
- gap: 16px;
- row-gap: 6px;
- padding: 16px 0 12px 0;
- margin-bottom: 22px;
- border-bottom: none;
- font-family: var(--font-ui);
- font-size: 15px;
- font-weight: 500;
- letter-spacing: 0.01em;
- }
- /* ----------------------------------------------------------
- Site Title
- ---------------------------------------------------------- */
- .hnname,
- .hnname a {
- font-family: var(--font-reading);
- font-size: 24px;
- font-weight: 600;
- letter-spacing: -0.01em;
- color: #d6e6ff;
- text-decoration: none;
- }
- /* Main Nav Links */
- .pagetop > a:not(.hnname),
- .pagetop b:not(.hnname) > a {
- font-family: var(--font-reading);
- font-size: 17px;
- font-weight: 500;
- letter-spacing: -0.01em;
- color: #a8c9ff;
- text-decoration: none;
- opacity: 0.85;
- transition:
- opacity 0.18s ease,
- color 0.18s ease;
- }
- .pagetop > a:not(.hnname):hover,
- .pagetop b:not(.hnname) > a:hover {
- color: #ffffff;
- opacity: 1;
- }
- /* Active page */
- .pagetop b:not(.hnname) {
- font-weight: inherit;
- }
- .pagetop b:not(.hnname) > a {
- color: #ffffff;
- opacity: 1;
- border-bottom: 2px solid var(--accent-blue);
- padding-bottom: 2px;
- }
- /* ----------------------------------------------------------
- Separator Pipes
- ---------------------------------------------------------- */
- .pagetop {
- color: #3a3a3a;
- }
- /* ----------------------------------------------------------
- Right Side User Block
- ---------------------------------------------------------- */
- .pagetop span:last-child {
- margin-left: auto;
- display: flex;
- align-items: center;
- gap: 6px;
- font-family: var(--font-reading);
- font-size: 17px;
- color: var(--text-muted);
- word-spacing: -2px;
- }
- /* Username */
- #me,
- .hnuser {
- color: #d6e6ff;
- font-weight: 500;
- letter-spacing: 0.02em;
- text-decoration: none;
- opacity: 0.9;
- }
- #me:hover,
- .hnuser:hover {
- opacity: 1;
- }
- /* Karma */
- #karma {
- color: var(--accent-orange);
- font-weight: 600;
- font-size: 17px;
- margin: 0 2px;
- }
- /* Logout */
- .pagetop a[href*='logout'] {
- color: var(--text-muted);
- opacity: 0.6;
- text-decoration: none;
- }
- .pagetop a[href*='logout']:hover {
- color: #ffffff;
- opacity: 1;
- }
- /* ----------------------------------------------------------
- Responsive
- ---------------------------------------------------------- */
- @media (max-width: 800px) {
- .pagetop {
- flex-direction: column;
- align-items: flex-start;
- }
- .pagetop span:last-child {
- margin-left: 0;
- font-family: var(--font-reading);
- font-size: 16px;
- gap: 4px;
- }
- }
- /* ==========================================================
- 6. STORY CARDS
- ========================================================== */
- html[op='news'] .athing.submission,
- html[op='newest'] .athing.submission,
- html[op='front'] .athing.submission,
- html[op='ask'] .athing.submission,
- html[op='show'] .athing.submission,
- html[op='jobs'] .athing.submission {
- padding: var(--story-padding-y) var(--story-padding-x);
- margin-bottom: var(--story-margin);
- background-color: var(--bg-card-1);
- border-radius: var(--radius-card);
- }
- html[op='news'] .athing.submission:nth-of-type(even),
- html[op='newest'] .athing.submission:nth-of-type(even),
- html[op='front'] .athing.submission:nth-of-type(even),
- html[op='ask'] .athing.submission:nth-of-type(even),
- html[op='show'] .athing.submission:nth-of-type(even),
- html[op='jobs'] .athing.submission:nth-of-type(even) {
- background-color: var(--bg-card-2);
- }
- .rank {
- color: var(--text-rank);
- font-size: 13px;
- padding-right: 8px;
- }
- /* ==========================================================
- 7. STORY TITLE CHIP
- ========================================================== */
- html[op='news'] .titleline > a,
- html[op='newest'] .titleline > a,
- html[op='front'] .titleline > a,
- html[op='ask'] .titleline > a,
- html[op='show'] .titleline > a,
- html[op='jobs'] .titleline > a,
- html[op='item'] .titleline > a {
- display: inline-block;
- padding: var(--title-padding-y) var(--title-padding-x);
- font-family: var(--font-ui);
- font-size: 18px;
- font-weight: 600;
- letter-spacing: -0.01em;
- line-height: 1.45;
- color: var(--text-primary);
- transition:
- color 0.18s ease,
- text-shadow 0.18s ease;
- }
- /* TEXT-ONLY Soft Glow Hover */
- .titleline > a:hover {
- color: #ffffff;
- text-shadow:
- 0 0 6px rgba(90, 169, 255, 0.55),
- 0 0 12px rgba(90, 169, 255, 0.25);
- }
- /* ==========================================================
- 8. STORY METADATA
- ========================================================== */
- .subtext,
- .subline {
- display: block;
- margin-top: 8px;
- color: var(--text-muted);
- font-size: 13px;
- line-height: 1.45;
- }
- /* ==========================================================
- 9. COMMENTS – Editorial Mode
- ========================================================== */
- html[op='item'] .comment,
- html[op='threads'] .comment {
- background-color: var(--bg-comment);
- padding: var(--comment-padding);
- border-radius: var(--radius-small);
- margin-bottom: 6px;
- border-left: 5px solid transparent;
- color: var(--text-primary) !important;
- }
- /* Editorial Reading Typography */
- html[op='item'] .commtext,
- html[op='threads'] .commtext {
- font-family: var(--font-reading);
- font-size: 14px;
- line-height: 1.45;
- max-width: 92ch !important;
- letter-spacing: 0.01em;
- font-feature-settings:
- 'liga' 1,
- 'kern' 1;
- font-kerning: normal;
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
- }
- /* Paragraph spacing */
- html[op='item'] .commtext p,
- html[op='threads'] .commtext p {
- margin-top: 0.8em;
- margin-bottom: 0.8em;
- text-indent: 1.4em;
- }
- /* ==========================================================
- STORY BODY – Editorial Reading Mode
- Launch HN / Ask HN story text
- ========================================================== */
- html[op='item'] .toptext {
- font-family: var(--font-reading);
- font-size: 14px;
- line-height: 1.4; /* tighter reading rhythm */
- letter-spacing: 0.01em;
- margin-top: 10px;
- color: var(--text-primary);
- }
- /* paragraph rhythm */
- html[op='item'] .toptext p {
- margin-top: 0.75em;
- margin-bottom: 0.75em;
- text-indent: 1.4em;
- }
- /* links match comment style */
- html[op='item'] .toptext a {
- text-decoration: none;
- border-bottom: 2px solid transparent;
- }
- html[op='item'] .toptext a:hover {
- border-bottom: 2px solid currentColor;
- }
- /* ==========================================================
- COMMENT LINK HOVER – Underline Only
- ========================================================== */
- html[op] .commtext a,
- html[op] .toptext a {
- color: var(--accent-blue);
- /* small preview-style container */
- background: rgba(90, 169, 255, 0.08);
- border: 1px solid rgba(90, 169, 255, 0.18);
- border-radius: 5px;
- padding: 1px 4px;
- /* remove default underline */
- text-decoration: none;
- /* invisible underline for hover */
- border-bottom: 2px solid transparent;
- }
- html[op] .commtext a:hover,
- html[op] .commtext a:focus,
- html[op] .commtext a:active,
- html[op] .toptext a:hover,
- html[op] .toptext a:focus,
- html[op] .toptext a:active {
- color: var(--accent-blue) !important;
- /* underline appears on hover */
- border-bottom: 2px solid var(--accent-blue);
- }
- /* prevent interference inside code / quotes */
- html[op] .commtext code a,
- html[op] .commtext pre a,
- html[op] .commtext blockquote a,
- html[op] .toptext code a,
- html[op] .toptext pre a,
- html[op] .toptext blockquote a {
- border: none;
- border-bottom: none;
- background: none;
- padding: 0;
- text-decoration: underline;
- }
- /* ==========================================================
- Depth Coloring – Thread Hierarchy
- ========================================================== */
- html[op='item'] td.ind[indent='0'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='0'] + td.votelinks + td.default .comment {
- border-left-color: #58a6ff;
- margin-top: 14px;
- }
- html[op='item'] td.ind[indent='1'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='1'] + td.votelinks + td.default .comment {
- border-left-color: #3fb950;
- }
- html[op='item'] td.ind[indent='2'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='2'] + td.votelinks + td.default .comment {
- border-left-color: #d29922;
- }
- html[op='item'] td.ind[indent='3'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='3'] + td.votelinks + td.default .comment {
- border-left-color: #f78166;
- }
- html[op='item'] td.ind[indent='4'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='4'] + td.votelinks + td.default .comment {
- border-left-color: #bc8cff;
- }
- html[op='item'] td.ind[indent='5'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='5'] + td.votelinks + td.default .comment {
- border-left-color: #79c0ff;
- }
- html[op='item'] td.ind[indent='6'] + td.votelinks + td.default .comment,
- html[op='threads'] td.ind[indent='6'] + td.votelinks + td.default .comment {
- border-left-color: #ff7b72;
- }
- /* ==========================================================
- 10. BUILT-IN TAG STYLING – Literary Mode
- ========================================================== */
- /* ---------- Inline Code ---------- */
- html[op] code {
- font-family: var(--font-mono) !important;
- font-size: 0.8em;
- line-height: 1.5;
- padding: 2px 6px;
- border-radius: 4px;
- background: #1a1a1a;
- color: #d8e2ff;
- border: 1px solid rgba(255, 255, 255, 0.06);
- letter-spacing: 0.02em;
- }
- /* ---------- Code Blocks ---------- */
- html[op] pre {
- margin: 1.4em 0;
- padding: 16px 18px;
- background: #171717;
- border: 1px solid #242424;
- border-radius: 8px;
- font-family:
- ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
- font-size: 14px;
- line-height: 1.7;
- color: #dde6ff;
- overflow-x: auto;
- }
- /* Allow long code lines to wrap instead of scrolling */
- html[op] pre code {
- white-space: pre !important;
- word-break: break-word;
- font-family: var(--font-mono);
- background: transparent;
- border: none;
- padding: 0;
- }
- /* ==========================================================
- BLOCKQUOTES – Editorial Highlight
- ========================================================== */
- html[op] blockquote {
- font-size: 14px;
- margin: 1.4em 0;
- padding: 1.05em 1.4em;
- background: linear-gradient(135deg, #1b1f26, #181a20);
- border-left: 4px solid var(--accent-blue);
- border-radius: 8px;
- box-shadow:
- 0 2px 6px rgba(0, 0, 0, 0.35),
- inset 0 0 0 1px rgba(255, 255, 255, 0.03);
- font-family: var(--font-reading);
- line-height: 1.6;
- color: #d5dbe6;
- }
- html[op] blockquote code {
- font-style: normal;
- }
- /* subtle quote glyph */
- html[op] blockquote::before {
- content: '❝';
- font-size: 40px;
- line-height: 0;
- color: var(--accent-blue);
- margin-right: 8px;
- opacity: 0.9;
- position: relative;
- top: 4px;
- }
- /* remove legacy browser quotes */
- html[op] blockquote::after {
- content: none;
- }
- /* ---------- Lists ---------- */
- html[op] .commtext ul,
- html[op] .commtext ol {
- margin: 1em 0 1em 1.6em;
- padding-left: 1.2em;
- }
- html[op] .commtext li {
- margin-bottom: 0.5em;
- }
- /* ---------- Horizontal Rule ---------- */
- html[op] hr {
- border: none;
- height: 1px;
- margin: 1.8em 0;
- background: linear-gradient(to right, transparent, #2a2a2a, transparent);
- }
- /* Prevent legacy font tag from interfering inside code/quotes */
- html[op] blockquote font,
- html[op] pre font,
- html[op] code font {
- color: inherit !important;
- }
- /* ==========================================================
- Forms, Footer, Accessibility
- ========================================================== */
- textarea,
- form input[type='text'] {
- background-color: var(--bg-comment);
- color: var(--text-primary);
- border: 1px solid var(--accent-blue);
- padding: 6px;
- border-radius: 5px;
- font-family: var(--font-ui);
- }
- input[type='submit'],
- button {
- font-family: var(--font-ui);
- font-size: 13px;
- font-weight: 500;
- letter-spacing: 0.02em;
- color: var(--text-primary);
- background: var(--bg-chip);
- border: 1px solid rgba(255, 255, 255, 0.08);
- border-radius: var(--radius-small);
- padding: 6px 12px;
- cursor: pointer;
- user-select: none;
- /* raised look */
- box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
- transition:
- background 0.15s ease,
- border-color 0.15s ease,
- box-shadow 0.15s ease,
- transform 0.08s ease;
- }
- input[type='submit']:hover,
- button:hover {
- border-color: var(--accent-blue);
- box-shadow: 0 0 0 2px rgba(90, 169, 255, 0.18);
- }
- input[type='submit']:active,
- button:active {
- /* press down */
- transform: translateY(2px);
- /* remove glow */
- box-shadow: 0 0 0 rgba(0, 0, 0, 0);
- /* subtle pressed tint */
- background: rgba(90, 169, 255, 0.1);
- border-color: var(--accent-blue);
- }
- .votearrow {
- background: url('triangle.svg') no-repeat;
- background-size: 10px;
- }
- .center,
- .yclinks a {
- color: var(--accent-blue);
- font-family: var(--font-reading);
- font-size: 15px;
- letter-spacing: -0.01em;
- }
- .yclinks a:hover {
- color: var(--accent-blue-hover);
- }
- .hnuser {
- font-variant: normal;
- letter-spacing: 0.03em;
- }
- /* Force comment text to respect dark theme */
- .comment,
- .commtext,
- .commtext * {
- color: var(--text-primary) !important;
- }
- font[color],
- font[color='#000000'],
- font[color='#000'] {
- color: var(--text-primary) !important;
- }
- /* ==========================================================
- SUBMIT PAGE FIX
- ========================================================== */
- html[op='submit'] #hnmain {
- background-color: transparent !important;
- }
- html[op='submit'] input[type='text'],
- html[op='submit'] input[type='url'],
- html[op='submit'] textarea {
- background-color: var(--bg-comment);
- color: var(--text-primary);
- border: 1px solid var(--accent-blue);
- border-radius: 5px;
- padding: 6px;
- font-family: var(--font-ui);
- }
- html[op='submit'] input[type='submit'] {
- background-color: var(--accent-blue);
- color: white;
- border: none;
- padding: 8px 12px;
- border-radius: 5px;
- cursor: pointer;
- font-family: var(--font-ui);
- }
- /* ==========================================================
- COMMENT WIDTH TWEAK
- ========================================================== */
- html[op='item'] .commtext,
- html[op='threads'] .commtext {
- max-width: 92ch !important;
- }
- /* ==========================================================
- CODE BLOCK LINE NUMBERS
- Matches enhanceCodeBlocks() JS
- ========================================================== */
- /* allow structured rows inside code blocks */
- html[op] pre code {
- font-family: var(--font-mono);
- display: block;
- white-space: pre !important;
- padding: 0;
- }
- /* each code line */
- .hn-code-line {
- display: grid;
- grid-template-columns: 36px 1fr;
- column-gap: 12px;
- line-height: 1.55;
- font-family: inherit;
- }
- /* line numbers */
- .hn-code-number {
- text-align: right;
- padding-right: 6px;
- color: #6e7681;
- opacity: 0.65;
- user-select: none;
- }
- /* code text */
- .hn-code-text {
- white-space: pre;
- }
- /* tighten code block slightly */
- html[op] pre {
- overflow-x: auto;
- }
- /* ==========================================================
- Highlight.js integration
- ========================================================== */
- .hljs {
- background: transparent !important;
- padding: 0 !important;
- }
- .hljs-comment,
- .hljs-quote {
- color: #7c8a9a;
- font-style: italic;
- }
- .hljs-keyword,
- .hljs-selector-tag,
- .hljs-subst {
- color: #ff7b72;
- }
- .hljs-string,
- .hljs-title,
- .hljs-name,
- .hljs-type {
- color: #a5d6ff;
- }
- .hljs-number,
- .hljs-literal {
- color: #79c0ff;
- }
- .hljs-built_in,
- .hljs-builtin-name {
- color: #ffa657;
- }
- pre code.hljs {
- font-family: var(--font-mono);
- white-space: pre;
- }
- .commtext ul.hn-auto-list {
- margin: 1em 0;
- padding-left: 1.6em;
- }
- .commtext ul.hn-auto-list li {
- margin-bottom: 0.4em;
- }
- /* ==========================================================
- DIAMOND BULLETS
- ========================================================== */
- /* ==========================================================
- DIAMOND BULLETS
- ========================================================== */
- .hn-bullet {
- position: relative;
- padding-left: 1.4em;
- margin-bottom: 0.35em;
- }
- .hn-bullet::before {
- content: '◆';
- position: absolute;
- left: 0;
- color: #5aa9ff;
- font-size: 0.9em;
- }
Add Comment
Please, Sign In to add comment