|
| 1 | +:root { |
| 2 | + --body-background-color: hsl(0, 0%, 100%); |
| 3 | + --body-color: hsl(0, 0%, 25%); |
| 4 | + --table-sticky-background-color: hsl(0, 0%, 92%); |
| 5 | + --link-color: hsl(210, 90%, 50%); |
| 6 | + --completion-complete-color: hsl(125, 60%, 35%); |
| 7 | +} |
| 8 | + |
| 9 | +@media (prefers-color-scheme: dark) { |
| 10 | + :root { |
| 11 | + --body-background-color: hsl(180, 5%, 15%); |
| 12 | + --body-color: hsl(0, 0%, 80%); |
| 13 | + --table-sticky-background-color: hsl(180, 5%, 15%); |
| 14 | + --link-color: hsl(200, 50%, 60%); |
| 15 | + --completion-complete-color: hsl(125, 50%, 65%); |
| 16 | + } |
| 17 | +} |
| 18 | + |
| 19 | +body { |
| 20 | + background-color: var(--body-background-color); |
| 21 | + color: var(--body-color); |
| 22 | + /* Use a modern font stack inspired by Bootstrap 4. */ |
| 23 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; |
| 24 | +} |
| 25 | + |
| 26 | +h1, |
| 27 | +p { |
| 28 | + text-align: center; |
| 29 | +} |
| 30 | + |
| 31 | +a { |
| 32 | + color: var(--link-color); |
| 33 | + text-decoration: none; |
| 34 | +} |
| 35 | + |
| 36 | +a:hover { |
| 37 | + text-decoration: underline; |
| 38 | +} |
| 39 | + |
| 40 | +table { |
| 41 | + border-collapse: collapse; |
| 42 | + margin: 2rem auto 0 auto; |
| 43 | +} |
| 44 | + |
| 45 | +td { |
| 46 | + border: 1px solid hsla(0, 0%, 50%, 50%); |
| 47 | + padding: 0.25rem 0.5rem; |
| 48 | + /* Prefer horizontal scrolling to wrapping over several lines. */ |
| 49 | + white-space: nowrap; |
| 50 | +} |
| 51 | + |
| 52 | +tr:hover { |
| 53 | + background-color: hsla(210, 90%, 50%, 12.5%); |
| 54 | +} |
| 55 | + |
| 56 | +tr:nth-child(even) { |
| 57 | + background-color: hsla(0, 0%, 50%, 10%); |
| 58 | +} |
| 59 | + |
| 60 | +tr:nth-child(even):hover { |
| 61 | + background-color: hsla(210, 90%, 50%, 15%); |
| 62 | +} |
| 63 | + |
| 64 | +/* Align class names to the right for better readability and highlight them. */ |
| 65 | +td:first-child { |
| 66 | + font-weight: bold; |
| 67 | + text-align: right; |
| 68 | +} |
| 69 | + |
| 70 | +/* Sticky header for the table. */ |
| 71 | +th { |
| 72 | + background: var(--table-sticky-background-color); |
| 73 | + box-shadow: 0px 2px 2px 0px rgb(0, 0, 0, 25%); |
| 74 | + padding: 4px 2px; |
| 75 | + position: -webkit-sticky; |
| 76 | + position: sticky; |
| 77 | + z-index: 1; /* Show on top of table cells. */ |
| 78 | + top: 0; /* Stick to the top of the screen. */ |
| 79 | + cursor: pointer; /* Visually hint that headers can be interacted with. */ |
| 80 | +} |
| 81 | +th:first-child { |
| 82 | + border-left: 1px solid var(--table-sticky-background-color); /* Fixes left border during scroll; must have a valid color, transparent doesn't work. */ |
| 83 | +} |
| 84 | + |
| 85 | +.completion-complete { |
| 86 | + color: var(--completion-complete-color); |
| 87 | +} |
| 88 | + |
| 89 | +/* Dynamic coloring depending on the completion percentage. */ |
| 90 | +/* Will be fully red at (roughly) 50% completion, and black/white (depending on the theme) at 99%. */ |
| 91 | +.completion-incomplete { |
| 92 | + font-weight: bold; |
| 93 | + color: rgb(calc(320 - calc(var(--percentage) * 3.2)), 64, 64); |
| 94 | +} |
| 95 | + |
| 96 | +@media (prefers-color-scheme: dark) { |
| 97 | + .completion-incomplete { |
| 98 | + --green-blue: calc(80 + calc(var(--percentage) * 2)); |
| 99 | + color: rgb(255, var(--green-blue), var(--green-blue)); |
| 100 | + } |
| 101 | +} |
0 commit comments