Skip to content
Source
Sign inSign up
samwillis/hackernews-realtime
Open History to see the last commit

globals.css

597 lines9.6 KB

1* {
2 box-sizing: border-box;
3}
4body {
5 margin: 8px;
6 padding-bottom: 98px;
7 background: #fff;
8 color: #000;
9 font-family: Verdana, Geneva, sans-serif;
10 font-size: 10pt;
12a {
13 color: inherit;
14 text-decoration: none;
16a:hover {
17 text-decoration: underline;
19a:focus-visible,
20button:focus-visible,
21input:focus-visible {
22 outline: 2px solid #444;
23 outline-offset: 2px;
25.hn-page {
26 width: 85%;
27 min-width: 0;
28 margin: 0 auto;
29 background: #f6f6ef;
31.hn-header {
32 display: flex;
33 align-items: center;
34 background: #ff6600;
35 padding: 2px;
36 gap: 5px;
37 min-height: 24px;
39.logo {
40 display: block;
41 height: 22px;
42 width: 22px;
43 border: 1px solid white;
44 text-align: center;
45 line-height: 20px;
46 font-family: Arial, sans-serif;
47 color: white;
48 font-size: 10px;
49 font-weight: bold;
50 flex-shrink: 0;
52.logo:hover {
53 text-decoration: none;
55.header-content {
56 display: flex;
57 align-items: baseline;
58 flex-wrap: wrap;
59 column-gap: 8px;
60 flex: 1;
61 min-width: 0;
63.site-title {
64 font-weight: bold;
65 white-space: nowrap;
67.neon-credit {
68 flex-shrink: 0;
69 margin-left: auto;
70 font-size: 7pt;
71 line-height: 14px;
72 white-space: nowrap;
74nav .selected {
75 color: #fff;
77.live-status {
78 color: #1f1f1f;
79 font-size: 7pt;
80 line-height: 14px;
81 display: flex;
82 align-items: center;
83 flex-wrap: wrap;
84 justify-content: flex-end;
85 gap: 3px;
87.live-status button {
88 background: none;
89 border: none;
90 padding: 0;
91 color: inherit;
92 cursor: pointer;
93 font: inherit;
94 display: inline-flex;
95 align-items: center;
96 gap: 4px;
98.live-status button:hover {
99 text-decoration: underline;
101.live-dot {
102 width: 5px;
103 height: 5px;
104 border-radius: 50%;
105 background: #555;
107.live-dot.on {
108 background: #3c8b42;
110.source-stale {
111 color: #612500;
113.stories {
114 padding: 0 5px 0 0;
115 margin: 10px 0 0;
116 list-style: none;
118.story {
119 padding-bottom: 7px;
121.story-main {
122 display: flex;
123 align-items: baseline;
124 min-height: 17px;
126.rank {
127 min-width: 28px;
128 text-align: right;
129 color: #828282;
131.vote {
132 width: 15px;
133 flex-shrink: 0;
134 align-self: start;
135 padding-top: 5px;
136 display: flex;
137 justify-content: center;
139.vote span {
140 width: 0;
141 height: 0;
142 border-left: 5px solid transparent;
143 border-right: 5px solid transparent;
144 border-bottom: 8px solid #828282;
146.no-vote {
147 visibility: hidden;
149.titleline {
150 line-height: 17px;
152.story-title:visited {
153 color: #828282;
155.domain,
156.subtext {
157 color: #828282;
158 font-size: 7pt;
160.domain a:hover,
161.subtext a:hover {
162 text-decoration: underline;
164.subtext {
165 padding-left: 43px;
166 line-height: 12px;
168.changed-value {
169 animation: glow 1.8s ease-out;
171@keyframes glow {
172 from {
173 background: #ffe6b3;
174 }
175 to {
176 background: transparent;
177 }
179.more {
180 display: inline-block;
181 margin: 4px 0 18px 43px;
183.empty {
184 margin: 15px 43px;
186@media (max-width: 750px) {
187 body {
188 margin: 0;
189 }
190 .hn-page {
191 min-width: 0;
192 width: 100%;
193 }
194 .hn-header {
195 min-height: 38px;
196 flex-wrap: wrap;
197 padding: 3px;
198 }
199 .header-content {
200 display: grid;
201 grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
202 align-items: center;
203 row-gap: 2px;
204 line-height: 15px;
205 }
206 .hn-header .logo {
207 align-self: flex-start;
208 }
209 .header-content .site-title {
210 grid-column: 1;
211 grid-row: 1;
212 }
213 .header-content .neon-credit {
214 grid-column: 2;
215 grid-row: 1;
216 }
217 nav {
218 font-size: 9pt;
219 }
220 .header-content nav {
221 grid-column: 1;
222 grid-row: 2;
223 }
224 .header-content .live-status {
225 grid-column: 2;
226 grid-row: 2;
227 max-width: 170px;
228 }
229 .rank {
230 min-width: 25px;
231 }
232 .vote {
233 width: 14px;
234 }
235 .story-title {
236 font-size: 11pt;
237 }
238 .domain {
239 font-size: 8pt;
240 }
241 .subtext {
242 padding-left: 39px;
243 font-size: 8pt;
244 line-height: 15px;
245 }
246 .story {
247 padding-bottom: 9px;
248 }
249 .more {
250 margin-left: 39px;
251 }
253@media (prefers-reduced-motion: reduce) {
254 .changed-row,
255 .changed-value {
256 animation: none;
257 background: #ffe6b3;
258 }
260​
261.thread-story {
262 margin: 12px 10px 0 15px;
264.thread-story .subtext {
265 padding-left: 15px;
267.story-body {
268 margin: 15px 0 0 15px;
270.discussion-actions {
271 margin: 16px 30px 22px;
272 font-size: 9pt;
274.discussion-actions a,
275.discussion-empty a,
276.thread-limit a {
277 text-decoration: underline;
279.comments {
280 list-style: none;
281 margin: 0;
282 padding: 0 12px 14px 15px;
284.comment {
285 margin-left: calc(var(--depth) * 20px);
286 padding-bottom: 16px;
288.comment-meta {
289 display: flex;
290 align-items: baseline;
291 flex-wrap: wrap;
292 column-gap: 4px;
293 color: #828282;
294 font-size: 8pt;
295 line-height: 16px;
297.comment-meta .vote {
298 margin-left: 0;
299 margin-right: 0;
300 padding-top: 3px;
302.comment-meta button {
303 border: 0;
304 background: none;
305 padding: 0;
306 color: inherit;
307 font: inherit;
308 cursor: pointer;
310.comment-meta button:hover {
311 text-decoration: underline;
313.comment-content {
314 margin-left: 15px;
316.comment-text {
317 font-size: 9pt;
318 line-height: 1.45;
319 overflow-wrap: anywhere;
321.comment-text p {
322 margin: 8px 0 0;
324.comment-text p:first-child {
325 margin-top: 0;
327.comment-text a {
328 text-decoration: underline;
330.comment-text pre {
331 overflow-x: auto;
332 white-space: pre-wrap;
334.reply {
335 display: inline-block;
336 font-size: 8pt;
337 margin-top: 6px;
338 text-decoration: underline;
340.dead-comment {
341 color: #828282;
343.discussion-empty,
344.thread-limit {
345 margin: 0 30px 24px;
346 color: #828282;
347 font-size: 9pt;
349@media (max-width: 1050px) and (min-width: 751px) {
350 .hn-header {
351 flex-wrap: wrap;
352 }
353 .live-controls {
354 font-size: 7pt;
355 }
357@media (max-width: 750px) {
358 .comment {
359 margin-left: calc(min(var(--depth), 5) * 14px);
360 }
361 .comments {
362 padding-right: 10px;
363 padding-left: 8px;
364 }
365 .thread-story {
366 margin-left: 8px;
367 }
368 .discussion-actions,
369 .discussion-empty,
370 .thread-limit {
371 margin-left: 23px;
372 }
374​
375.event-timeline {
376 position: fixed;
377 z-index: 20;
378 bottom: 0;
379 left: 0;
380 right: 0;
381 border-top: 2px solid #ff6600;
382 background: #f6f6ef;
383 padding: 9px max(18px, 7.5vw) calc(9px + env(safe-area-inset-bottom));
384 font-size: 8pt;
385 box-shadow: 0 -3px 12px #00000008;
387.timeline-heading {
388 display: flex;
389 align-items: center;
390 gap: 20px;
391 color: #555;
393.timeline-heading strong {
394 color: #222;
396.timeline-count,
397.timeline-status {
398 color: #777;
399 font-size: 7pt;
401.timeline-status {
402 margin-left: auto;
404.timeline-legend {
405 display: flex;
406 align-items: center;
407 gap: 5px;
408 font-size: 7pt;
409 white-space: nowrap;
411.legend-dot {
412 display: inline-block;
413 width: 6px;
414 height: 6px;
415 flex-shrink: 0;
416 border-radius: 50%;
418.on-screen {
419 background: #ff6600;
421.elsewhere {
422 background: #92928a;
424.timeline-legend .elsewhere {
425 margin-left: 8px;
427.timeline-track {
428 height: 48px;
429 margin-top: 3px;
430 position: relative;
432.timeline-axis {
433 position: absolute;
434 top: 26px;
435 width: 100%;
436 border-top: 1px solid #d6d6ce;
438.timeline-tick {
439 position: absolute;
440 top: 32px;
441 font-size: 7pt;
442 color: #888;
443 transform: translateX(-50%);
445.timeline-tick:first-of-type {
446 transform: none;
448.timeline-tick:last-of-type {
449 transform: translateX(-100%);
451.timeline-empty {
452 position: absolute;
453 top: 9px;
454 left: 0;
455 font-size: 7pt;
456 color: #888;
458.timeline-bucket {
459 position: absolute;
460 top: 0;
461 height: 30px;
462 min-width: 8px;
463 padding: 0 2px;
464 border: 0;
465 background: transparent;
466 font: inherit;
467 cursor: pointer;
468 transform: translateX(-50%);
469 transition: left 0.1s linear;
470 display: flex;
471 flex-direction: column-reverse;
472 align-items: center;
474.bucket-dots {
475 display: flex;
476 align-items: flex-end;
477 gap: 1px;
478 padding-bottom: 3px;
480.event-stack {
481 width: 3px;
482 border-radius: 2px 2px 0 0;
484.bucket-count {
485 font-size: 6pt;
486 color: #666;
487 line-height: 10px;
489.timeline-bucket.active {
490 background: #ffe6b3;
491 border-radius: 3px;
493.timeline-details {
494 position: absolute;
495 bottom: calc(100% + 8px);
496 right: max(12px, 7.5vw);
497 width: min(440px, calc(100vw - 24px));
498 background: #fffef9;
499 border: 1px solid #c9c9c0;
500 border-top: 2px solid #ff6600;
501 box-shadow: 0 3px 18px #0002;
502 padding: 12px;
503 text-align: left;
505.event-timeline:has(.timeline-details)::before {
506 content: "";
507 position: absolute;
508 top: -10px;
509 left: 0;
510 right: 0;
511 height: 10px;
513.timeline-detail-heading {
514 display: flex;
515 align-items: center;
516 justify-content: space-between;
517 font-size: 8pt;
519.timeline-detail-heading button {
520 background: none;
521 border: 0;
522 cursor: pointer;
523 font-size: 18px;
524 color: #666;
525 padding: 0 3px;
527.timeline-details ul {
528 list-style: none;
529 margin: 10px 0 0;
530 padding: 0;
531 max-height: min(45vh, 300px);
532 overflow-y: auto;
533 overscroll-behavior: contain;
535.timeline-details li {
536 display: flex;
537 align-items: baseline;
538 gap: 8px;
539 padding: 8px 0;
540 border-top: 1px solid #eeeee6;
542.timeline-details li:first-child {
543 border-top: 0;
544 padding-top: 0;
546.timeline-details li > div {
547 min-width: 0;
549.timeline-details a {
550 font-size: 9pt;
551 overflow-wrap: anywhere;
553.timeline-details p {
554 color: #666;
555 font-size: 7pt;
556 line-height: 1.5;
557 margin: 4px 0;
558 overflow-wrap: anywhere;
560.event-location {
561 font-size: 7pt;
562 color: #888;
564.event-in-view .event-location {
565 color: #b84a00;
567@media (max-width: 750px) {
568 .event-timeline {
569 padding-left: 14px;
570 padding-right: 14px;
571 }
572 .timeline-heading {
573 gap: 10px;
574 flex-wrap: wrap;
575 }
576 .timeline-status {
577 display: none;
578 }
579 .timeline-legend {
580 margin-left: auto;
581 }
582 .timeline-count {
583 font-size: 6pt;
584 }
585 .timeline-details {
586 right: 12px;
587 }
589@media (prefers-reduced-motion: reduce) {
590 .timeline-bucket {
591 transition: none;
592 }
594a[aria-busy="true"] {
595 cursor: progress;
596 opacity: 0.65;