styles.css 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. /* Reset a couple of things for the sake of ease */
  2. * {
  3. padding: 0;
  4. margin: 0;
  5. }
  6. /* Variables */
  7. /* Dark by default */
  8. :root {
  9. --color-background: #151515;
  10. --color-background-alternative: #4f4f4f;
  11. --color-text-default: #f0f0f0;
  12. --color-text-alternative: #808080;
  13. --color-accent-1: #f1c40f;
  14. --color-accent-2: #9b59b6;
  15. --color-accent-3: #1abc9c;
  16. }
  17. /* If the user has set a preference, respect it */
  18. @media (prefers-color-scheme: light) {
  19. :root {
  20. --color-background: #f0f0f0;
  21. --color-background-alternative: #afafaf;
  22. --color-text-default: #0e0e0e;
  23. --color-text-alternative: #4f4f4f;
  24. --color-accent-1: #3498db;
  25. --color-accent-2: #2ecc71;
  26. --color-accent-3: #e74c3c;
  27. }
  28. }
  29. /* Class-based switching for overriding the system preference */
  30. .light {
  31. --color-background: #f0f0f0;
  32. --color-background-alternative: #afafaf;
  33. --color-text-default: #0e0e0e;
  34. --color-text-alternative: #4f4f4f;
  35. --color-accent-1: #3498db;
  36. --color-accent-2: #2ecc71;
  37. --color-accent-3: #e74c3c;
  38. }
  39. .dark {
  40. --color-background: #151515;
  41. --color-background-alternative: #4f4f4f;
  42. --color-text-default: #f0f0f0;
  43. --color-text-alternative: #808080;
  44. --color-accent-1: #f1c40f;
  45. --color-accent-2: #9b59b6;
  46. --color-accent-3: #1abc9c;
  47. }
  48. /* End variables */
  49. /* General styles */
  50. body {
  51. transition: color 0.5s, background-color 0.5s;
  52. background-color: var(--color-background);
  53. color: var(--color-text-default);
  54. line-height: 1.6em;
  55. letter-spacing: 0.025em;
  56. font-family: "Noto sans", sans-serif;
  57. font-weight: 300;
  58. }
  59. section {
  60. max-width: 42vw;
  61. margin: 0 auto 3em auto;
  62. overflow: hidden;
  63. clear: both;
  64. display: block;
  65. }
  66. code {
  67. font-size: 1em;
  68. padding: 0 0.2em;
  69. margin: 1em auto 2em auto;
  70. font-family: "Hack", monospace;
  71. background-color: var(--color-background-alternative);
  72. }
  73. article {
  74. margin: 1em auto 4em auto;
  75. }
  76. section img {
  77. display: block;
  78. margin: 2em auto 0.2em auto;
  79. max-width: 100%;
  80. }
  81. section img + em {
  82. font-family: "NotoSerif", serif;
  83. font-size: 0.8em;
  84. text-align: center;
  85. display: block;
  86. }
  87. h1 {
  88. display: inline;
  89. font-family: "NotoSerif", serif;
  90. font-size: 2.4em;
  91. letter-spacing: 0.05em;
  92. line-height: 1.6em;
  93. margin: 0 0 1.2em 0;
  94. }
  95. h2 {
  96. color: var(--color-text-alternative);
  97. font-family: "NotoSans", sans-serif;
  98. font-weight: 400;
  99. font-size: 1.2em;
  100. margin: 2em 0 1em 0;
  101. }
  102. article h2 {
  103. margin-top: 2em;
  104. }
  105. h3 {
  106. display: block;
  107. margin: 1.6em 0 1em 0;
  108. font-family: "NotoSans", sans-serif;
  109. font-weight: bold;
  110. font-weight: 400;
  111. letter-spacing: 0.025em;
  112. font-size: 1em;
  113. line-height: 1.6em;
  114. }
  115. a,
  116. a:active,
  117. a:visited {
  118. background-color: var(--color-accent-1);
  119. color: var(--color-background);
  120. text-decoration: none;
  121. padding: 0 0.2em;
  122. }
  123. ul li {
  124. margin: 0.2em 0.2em 0.2em 2em;
  125. padding-left: 0.4em;
  126. }
  127. p {
  128. line-height: 1.75em;
  129. margin: 2em 0;
  130. }
  131. /* Footer */
  132. footer {
  133. margin-top: 6em;
  134. padding: 2em 0;
  135. color: var(--color-text-default);
  136. display: flex;
  137. margin: 3em auto 3.5em auto;
  138. align-items: stretch;
  139. justify-content: stretch;
  140. max-width: 82vw;
  141. display: flex;
  142. flex-flow: row;
  143. flex-wrap: wrap;
  144. }
  145. footer p {
  146. display: inline-block;
  147. flex: 1;
  148. padding: 1em 0 0.5em 0;
  149. font-size: 0.75em;
  150. text-align: center;
  151. color: var(--color-text-alternative);
  152. }
  153. /* Styles for pseudo-button links */
  154. .blocklink,
  155. .blocklink:active,
  156. .blocklink:visited {
  157. margin: 0.4em;
  158. border: 0.4em solid;
  159. border-color: var(--color-accent-3);
  160. background-color: var(--color-background);
  161. text-decoration: none;
  162. padding: 0.2em 0.5em;
  163. text-transform: uppercase;
  164. float: right;
  165. color: var(--color-text-default);
  166. font-weight: bold;
  167. }
  168. /* Header */
  169. header {
  170. margin: 3vw auto 2em auto;
  171. display: flex;
  172. flex-flow: row;
  173. max-width: 80vw;
  174. padding: 1em;
  175. }
  176. header div {
  177. margin: 0 auto 2em auto;
  178. margin: 0 auto;
  179. flex: 1;
  180. display: flex;
  181. flex-flow: row;
  182. max-width: 300px;
  183. }
  184. .controls svg,
  185. .controls a {
  186. flex: 1;
  187. width: 2em;
  188. height: 3em;
  189. color: var(--color-text-alternative);
  190. background-color: transparent;
  191. }
  192. /* Dark/light mode switches */
  193. .switches {
  194. display: flex;
  195. align-content: space-around;
  196. align-items: flex-start;
  197. justify-content: flex-end;
  198. }
  199. .switches svg {
  200. height: 1.4em;
  201. width: 1.4em;
  202. }
  203. .lightswitch,
  204. .darkswitch {
  205. display: flex;
  206. align-content: space-around;
  207. align-items: center;
  208. justify-content: center;
  209. border: none;
  210. border-radius: 0;
  211. color: var(--color-background);
  212. height: 2em;
  213. width: 2em;
  214. }
  215. .lightswitch {
  216. background-color: var(--color-background-alternative);
  217. color: var(--color-text-default);
  218. }
  219. .darkswitch {
  220. background-color: var(--color-accent-3);
  221. }
  222. @media (prefers-color-scheme: light) {
  223. .darkswitch {
  224. background-color: var(--color-background);
  225. background-color: var(--color-background-alternative);
  226. color: var(--color-text-default);
  227. }
  228. .lightswitch {
  229. background-color: var(--color-accent-3);
  230. }
  231. }
  232. .light .darkswitch {
  233. background-color: var(--color-background-alternative);
  234. color: var(--color-text-default);
  235. }
  236. .light .lightswitch {
  237. background-color: var(--color-accent-3);
  238. }
  239. /* To display uls as a file tree-like list */
  240. .filetree,
  241. .filetree ul,
  242. .filetree li {
  243. position: relative;
  244. }
  245. .filetree li {
  246. margin: 0.6em 0;
  247. }
  248. .filetree ul {
  249. list-style: none;
  250. padding-left: 3.2em;
  251. }
  252. .filetree li::before,
  253. .filetree li::after {
  254. content: "";
  255. position: absolute;
  256. left: -1.2em;
  257. }
  258. .filetree li::before {
  259. border-top: 0.1em solid var(--color-text-default);
  260. top: 0.8em;
  261. width: 0.8em;
  262. height: 0;
  263. }
  264. .filetree li::after {
  265. border-left: 0.1em solid var(--color-text-default);
  266. height: 2.6em;
  267. width: 0;
  268. top: 0.2em;
  269. }
  270. .filetree ul > li:last-child::after {
  271. height: 0.7em;
  272. }
  273. /* Contact card */
  274. .contact-card li {
  275. display: inline;
  276. margin: 0 1em 1em 0;
  277. padding-left: 0;
  278. }
  279. .contact-card svg {
  280. height: 1.4em;
  281. width: 1.4em;
  282. margin-right: 0.4em;
  283. }
  284. .contact-card a {
  285. display: inline-flex;
  286. flex-direction: row;
  287. align-content: space-around;
  288. align-items: center;
  289. justify-content: flex-start;
  290. text-decoration: none;
  291. }
  292. .article-meta {
  293. display: flex;
  294. padding-top: 4em;
  295. font-size: 0.8em;
  296. flex-direction: column;
  297. }
  298. .article-meta span {
  299. display: inline-block;
  300. flex: 1;
  301. }
  302. /* Smaller screen tweaks */
  303. @media screen and (max-width: 940px) {
  304. body {
  305. font-size: 22px;
  306. }
  307. .switches button {
  308. font-size: 22px;
  309. }
  310. section {
  311. max-width: 90vw;
  312. }
  313. header {
  314. max-width: 90vw;
  315. margin-bottom: 2em;
  316. }
  317. footer {
  318. padding: 0;
  319. }
  320. footer {
  321. flex-flow: column;
  322. margin: 0;
  323. }
  324. footer p {
  325. padding: 1em;
  326. border-bottom: none;
  327. border-left: 0.5em solid;
  328. margin: 0 1em;
  329. }
  330. }
  331. /* Fonts */
  332. @font-face {
  333. font-family: "Noto sans";
  334. src: local("Noto Sans Regular"), local("Noto Sans"),
  335. url("/fonts/notosans-regular.woff2") format("woff2"),
  336. url("/fonts/notosans-regular.woff") format("woff"),
  337. url("/fonts/notosans-regular.ttf") format("truetype");
  338. font-weight: normal;
  339. font-style: normal;
  340. font-display: swap;
  341. }
  342. @font-face {
  343. font-family: "Hack";
  344. src: local("Hack Regular"), local("Hack"),
  345. url("/fonts/hack-regular.woff2") format("woff2"),
  346. url("/fonts/hack-regular.woff") format("woff"),
  347. url("/fonts/hack-regular.ttf") format("truetype");
  348. font-weight: normal;
  349. font-style: normal;
  350. font-display: swap;
  351. }
  352. @font-face {
  353. font-family: "Hack";
  354. src: local("Hack Italic"), local("Hack-Italic"),
  355. url("/fonts/hack-italic.woff2") format("woff2"),
  356. url("/fonts/hack-italic.woff") format("woff"),
  357. url("/fonts/hack-italic.ttf") format("truetype");
  358. font-weight: normal;
  359. font-style: italic;
  360. font-display: swap;
  361. }
  362. @font-face {
  363. font-family: "Hack";
  364. src: local("Hack Bold"), local("Hack-Bold"),
  365. url("/fonts/hack-bold.woff2") format("woff2"),
  366. url("/fonts/hack-bold.woff") format("woff"),
  367. url("/fonts/hack-bold.ttf") format("truetype");
  368. font-weight: bold;
  369. font-style: normal;
  370. font-display: swap;
  371. }
  372. @font-face {
  373. font-family: "NotoSerif";
  374. src: local("NotoSerif Regular"), local("NotoSerif"),
  375. url("/fonts/notoserif-regular.woff2") format("woff2"),
  376. url("/fonts/notoserif-regular.woff") format("woff"),
  377. url("/fonts/notoserif-regular.ttf") format("truetype");
  378. font-weight: normal;
  379. font-style: normal;
  380. font-display: swap;
  381. }
  382. /* Arta HighlightJS theme */
  383. .hljs {
  384. display: block;
  385. overflow-x: auto;
  386. padding: 0.5em;
  387. background: #222;
  388. }
  389. .hljs,
  390. .hljs-subst {
  391. color: #aaa;
  392. }
  393. .hljs-section {
  394. color: #fff;
  395. }
  396. .hljs-comment,
  397. .hljs-quote,
  398. .hljs-meta {
  399. color: #444;
  400. }
  401. .hljs-string,
  402. .hljs-symbol,
  403. .hljs-bullet,
  404. .hljs-regexp {
  405. color: #ffcc33;
  406. }
  407. .hljs-number,
  408. .hljs-addition {
  409. color: #00cc66;
  410. }
  411. .hljs-built_in,
  412. .hljs-builtin-name,
  413. .hljs-literal,
  414. .hljs-type,
  415. .hljs-template-variable,
  416. .hljs-attribute,
  417. .hljs-link {
  418. color: #32aaee;
  419. }
  420. .hljs-keyword,
  421. .hljs-selector-tag,
  422. .hljs-name,
  423. .hljs-selector-id,
  424. .hljs-selector-class {
  425. color: #6644aa;
  426. }
  427. .hljs-title,
  428. .hljs-variable,
  429. .hljs-deletion,
  430. .hljs-template-tag {
  431. color: #bb1166;
  432. }
  433. .hljs-section,
  434. .hljs-doctag,
  435. .hljs-strong {
  436. font-weight: bold;
  437. }
  438. .hljs-emphasis {
  439. font-style: italic;
  440. }