|
| 1 | +/* Dark mode overrides. Light is the default; these rules apply only when |
| 2 | + data-theme="dark" is set on <html> (see theme-toggle.js). */ |
| 3 | + |
| 4 | +/* TOGGLE BUTTON */ |
| 5 | + |
| 6 | +.theme-toggle { |
| 7 | + position: absolute; |
| 8 | + top: 14px; |
| 9 | + right: 14px; |
| 10 | + z-index: 1000; |
| 11 | + display: flex; |
| 12 | + align-items: center; |
| 13 | + justify-content: center; |
| 14 | + width: 40px; |
| 15 | + height: 40px; |
| 16 | + padding: 0; |
| 17 | + color: #fff; |
| 18 | + cursor: pointer; |
| 19 | + background: rgba(13, 27, 42, 0.35); |
| 20 | + border: solid 1px rgba(255, 255, 255, 0.55); |
| 21 | + border-radius: 50%; |
| 22 | + appearance: none; |
| 23 | + -webkit-appearance: none; |
| 24 | + transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease; |
| 25 | +} |
| 26 | +.theme-toggle:hover { |
| 27 | + background: rgba(13, 27, 42, 0.6); |
| 28 | + transform: scale(1.06); |
| 29 | +} |
| 30 | +.theme-toggle:focus-visible { |
| 31 | + outline: solid 2px #9ddcff; |
| 32 | + outline-offset: 2px; |
| 33 | +} |
| 34 | +.theme-toggle svg { |
| 35 | + display: block; |
| 36 | + width: 22px; |
| 37 | + height: 22px; |
| 38 | + fill: currentColor; |
| 39 | +} |
| 40 | + |
| 41 | +/* Moon shows in light mode; sun shows in dark mode. */ |
| 42 | +.theme-toggle .icon-sun { |
| 43 | + display: none; |
| 44 | +} |
| 45 | +.theme-toggle .icon-moon { |
| 46 | + display: block; |
| 47 | +} |
| 48 | +html[data-theme="dark"] .theme-toggle .icon-sun { |
| 49 | + display: block; |
| 50 | +} |
| 51 | +html[data-theme="dark"] .theme-toggle .icon-moon { |
| 52 | + display: none; |
| 53 | +} |
| 54 | +html[data-theme="dark"] .theme-toggle { |
| 55 | + color: #ffd45e; |
| 56 | + background: rgba(230, 233, 238, 0.12); |
| 57 | + border-color: rgba(230, 233, 238, 0.5); |
| 58 | +} |
| 59 | +html[data-theme="dark"] .theme-toggle:hover { |
| 60 | + background: rgba(230, 233, 238, 0.22); |
| 61 | +} |
| 62 | + |
| 63 | +/* LAYOUT STYLES */ |
| 64 | + |
| 65 | +html[data-theme="dark"] body { |
| 66 | + color: #c7cbd1; |
| 67 | + background: #14171c; |
| 68 | + background-image: none; |
| 69 | +} |
| 70 | + |
| 71 | +html[data-theme="dark"] a { |
| 72 | + color: #6cb0f0; |
| 73 | +} |
| 74 | +html[data-theme="dark"] a:hover { |
| 75 | + color: #8cc4f7; |
| 76 | +} |
| 77 | + |
| 78 | +html[data-theme="dark"] header { |
| 79 | + background: #0d1b2a; |
| 80 | + background-image: none; |
| 81 | + border-bottom-color: #1d2b3a; |
| 82 | +} |
| 83 | + |
| 84 | +html[data-theme="dark"] #content-wrapper { |
| 85 | + border-top-color: #2d333b; |
| 86 | +} |
| 87 | + |
| 88 | +html[data-theme="dark"] aside#sidebar { |
| 89 | + background-image: none; |
| 90 | +} |
| 91 | + |
| 92 | +/* The base theme forces the current nav item to black; restore it for dark. */ |
| 93 | +html[data-theme="dark"] .sidebar.current { |
| 94 | + color: #fff; |
| 95 | + text-decoration-color: #fff; |
| 96 | +} |
| 97 | + |
| 98 | +html[data-theme="dark"] code, |
| 99 | +html[data-theme="dark"] pre { |
| 100 | + color: #c7cbd1; |
| 101 | +} |
| 102 | +html[data-theme="dark"] code { |
| 103 | + background-color: #1c2128; |
| 104 | + border-color: #2d333b; |
| 105 | +} |
| 106 | +html[data-theme="dark"] pre { |
| 107 | + background: #1c2128; |
| 108 | + border-color: #2d333b; |
| 109 | +} |
| 110 | +html[data-theme="dark"] pre code { |
| 111 | + color: #c7cbd1; |
| 112 | + background-color: transparent; |
| 113 | +} |
| 114 | + |
| 115 | +/* COMMON STYLES */ |
| 116 | + |
| 117 | +html[data-theme="dark"] hr { |
| 118 | + border-top-color: #2d333b; |
| 119 | +} |
| 120 | + |
| 121 | +html[data-theme="dark"] table, |
| 122 | +html[data-theme="dark"] td { |
| 123 | + border-color: #2d333b; |
| 124 | +} |
| 125 | + |
| 126 | +html[data-theme="dark"] form { |
| 127 | + background: #1c2128; |
| 128 | +} |
| 129 | + |
| 130 | +/* GENERAL ELEMENT TYPE STYLES */ |
| 131 | + |
| 132 | +html[data-theme="dark"] #main-content h1, |
| 133 | +html[data-theme="dark"] #main-content h2, |
| 134 | +html[data-theme="dark"] #main-content h3, |
| 135 | +html[data-theme="dark"] #main-content h4, |
| 136 | +html[data-theme="dark"] #main-content h5, |
| 137 | +html[data-theme="dark"] #main-content h6 { |
| 138 | + color: #e6e9ee; |
| 139 | +} |
| 140 | + |
| 141 | +html[data-theme="dark"] blockquote { |
| 142 | + border-left-color: #3a4250; |
| 143 | +} |
| 144 | + |
| 145 | +html[data-theme="dark"] footer { |
| 146 | + color: #8b919a; |
| 147 | +} |
| 148 | +html[data-theme="dark"] footer a { |
| 149 | + color: #aab1bb; |
| 150 | +} |
| 151 | +html[data-theme="dark"] footer a:hover { |
| 152 | + color: #cfd4db; |
| 153 | +} |
0 commit comments