style.scss 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. @import "predefined.scss";
  2. *,
  3. ::before,
  4. ::after {
  5. box-sizing: border-box;
  6. }
  7. @view-transition {
  8. navigation: auto;
  9. }
  10. .skip-to-content-link {
  11. position: absolute;
  12. z-index: 100;
  13. padding: .5em;
  14. transform: translateY(-200%);
  15. transition: transform 0.3s;
  16. background-color: var(--c-bg-alt);
  17. &:focus {
  18. transform: translateY(0);
  19. }
  20. }
  21. html {
  22. -moz-tab-size: 4;
  23. tab-size: 4;
  24. scroll-behavior: smooth;
  25. line-height: 1.7;
  26. --c-bg: #f3f6f6;
  27. --c-bg-alt: #dee8e5;
  28. --c-txt: #545250;
  29. --c-txt-alt: #72706e;
  30. --c-txt-alt2: rgba(114, 112, 110, .3);
  31. --c-txt-em: #333333;
  32. }
  33. body {
  34. margin: 0;
  35. padding: 1rem;
  36. min-height: 100vh;
  37. min-height: 100dvh;
  38. }
  39. body,
  40. button,
  41. input,
  42. select,
  43. textarea {
  44. color: var(--c-txt);
  45. background-color: var(--c-bg);
  46. font-family: $fonts-sans;
  47. transition: color .5s, background-color .5s, border-color .5s;
  48. }
  49. // Auto light/dark mode
  50. @media (prefers-color-scheme: dark) {
  51. html {
  52. --c-bg: #1c1f21;
  53. --c-bg-alt: #313a3f;
  54. --c-txt: #bababa;
  55. --c-txt-alt: #8f8f8f;
  56. --c-txt-alt2: rgba(140, 140, 140, .5);
  57. --c-txt-em: #dedede;
  58. }
  59. main img {
  60. filter: brightness(.9);
  61. transition: filter .3s;
  62. &:hover {
  63. filter: none;
  64. }
  65. }
  66. }
  67. // Global style
  68. //
  69. h1,
  70. h2,
  71. h3,
  72. h4,
  73. h5,
  74. h6 {
  75. font-weight: bold;
  76. margin-bottom: 1rem;
  77. }
  78. ul,
  79. ol {
  80. padding-inline-start: 1.25em;
  81. }
  82. li::marker {
  83. font-size: 90%;
  84. color: var(--c-txt-alt);
  85. }
  86. // lsn -> list-style: none
  87. .lsn {
  88. list-style: none;
  89. padding-inline-start: 0;
  90. margin: 0;
  91. }
  92. // tdln -> text-decoration-line: none
  93. .tdln,
  94. .tdln a {
  95. text-decoration-line: none;
  96. }
  97. .dim {
  98. color: var(--c-txt-alt)
  99. }
  100. .dimmer {
  101. color: var(--c-txt-alt2)
  102. }
  103. a {
  104. color: var(--c-txt);
  105. text-decoration-color: var(--c-txt-alt2);
  106. text-decoration-thickness: 1px;
  107. text-underline-offset: 0.25em;
  108. transition: color .3s, text-decoration-color .3s, border-color .3s;
  109. &:hover {
  110. color: $accent;
  111. text-decoration-color: $accent;
  112. }
  113. &:active {
  114. text-decoration-style: dashed;
  115. }
  116. }
  117. pre,
  118. code,
  119. pre tt {
  120. font-family: var(--fonts-mono);
  121. }
  122. pre {
  123. padding: .7em 1.1em;
  124. overflow: auto;
  125. font-size: 90%;
  126. line-height: 1.2;
  127. white-space: pre;
  128. background-color: var(--c-bg-alt);
  129. code {
  130. padding: 0;
  131. margin: 0;
  132. background: transparent;
  133. }
  134. }
  135. code {
  136. background: var(--c-bg-alt);
  137. padding: 0 3px;
  138. margin: 0 2px;
  139. }
  140. blockquote {
  141. margin: 1.5rem 1rem;
  142. font: italic 125% var(--fonts-serif);
  143. color: var(--c-txt-alt);
  144. &::before {
  145. content: "“";
  146. position: absolute;
  147. z-index: -1;
  148. line-height: 1;
  149. font-size: 500%;
  150. transform: translate(-1rem, -1rem);
  151. color: var(--c-bg-alt);
  152. }
  153. p {
  154. margin-left: 1.5em;
  155. }
  156. cite {
  157. font-weight: bold;
  158. font-style: normal;
  159. font-size: 75%;
  160. &::before {
  161. content: "― ";
  162. }
  163. }
  164. }
  165. table {
  166. border-collapse: collapse;
  167. border-spacing: 0;
  168. empty-cells: show;
  169. width: 100%;
  170. max-width: 100%;
  171. th,
  172. td {
  173. padding: 1.5%;
  174. border: 1px solid var(--c-txt-alt2);
  175. }
  176. th {
  177. font-weight: bold;
  178. vertical-align: bottom;
  179. background-color: var(--c-bg-alt);
  180. }
  181. }
  182. hr {
  183. width: auto;
  184. height: 2rem;
  185. border: none;
  186. text-align: center;
  187. color: var(--c-txt-alt2);
  188. margin-left: 0;
  189. &::after {
  190. content: "* * *";
  191. display: block;
  192. font-size: 150%;
  193. }
  194. }
  195. button,
  196. [type=button],
  197. [type=reset],
  198. [type=submit] {
  199. border: 1px solid var(--c-txt-alt);
  200. &:hover {
  201. border-color: $accent;
  202. }
  203. &:active {
  204. border-style: dashed;
  205. }
  206. }
  207. input[type=text],
  208. input[type=email],
  209. input[type=url] {
  210. width: 100%;
  211. border: 1px solid var(--c-txt-alt);
  212. border-width: 0 0 1px 0;
  213. background-color: transparent;
  214. }
  215. textarea {
  216. width: 100%;
  217. max-width: 100%;
  218. padding: 2px 6px;
  219. border: 1px solid var(--c-txt-alt);
  220. background-color: transparent;
  221. }
  222. .feather {
  223. display: inline-block;
  224. vertical-align: -.125em;
  225. width: 1em;
  226. height: 1em;
  227. }
  228. .wrapper {
  229. display: flex;
  230. flex-direction: column;
  231. }
  232. .site-header {
  233. display: grid;
  234. grid-template-columns: 3fr 1fr;
  235. padding-bottom: 1rem;
  236. margin-bottom: .5rem;
  237. line-height: 1.2;
  238. border-bottom: 1px solid var(--c-bg-alt);
  239. view-transition-name: site-header;
  240. }
  241. .site-title {
  242. font-weight: bold;
  243. }
  244. .site-nav {
  245. display: none;
  246. flex-grow: 1;
  247. text-align: center;
  248. a {
  249. position: relative;
  250. margin: 0 .5rem;
  251. &.active::after {
  252. content: '*';
  253. position: absolute;
  254. top: 0;
  255. right: -.5em;
  256. font-size: 90%;
  257. color: $accent;
  258. }
  259. }
  260. }
  261. .rss-icon {
  262. text-align: right;
  263. }
  264. .site-main {
  265. flex: 1;
  266. }
  267. .site-footer {
  268. padding-top: 1rem;
  269. margin-top: 2rem;
  270. font-size: 80%;
  271. border-top: 1px solid var(--c-bg-alt);
  272. view-transition-name: site-footer;
  273. }
  274. .page-title {
  275. max-width: 48em;
  276. margin: auto;
  277. }
  278. h1 {
  279. margin: 1rem 0 .25rem;
  280. font-size: 175%;
  281. line-height: 1.4;
  282. }
  283. .post-info {
  284. font-size: 90%;
  285. margin-bottom: 1rem;
  286. a {
  287. margin-right: .25em;
  288. &::before {
  289. content: "#";
  290. }
  291. }
  292. }
  293. .content {
  294. max-width: 48em;
  295. margin: auto;
  296. overflow-wrap: break-word;
  297. figure {
  298. height: auto;
  299. margin: 0 0 .25rem;
  300. text-align: center;
  301. }
  302. figcaption>p {
  303. margin: 0 0 1em;
  304. font-size: 75%;
  305. color: var(--c-txt-alt);
  306. &::before {
  307. content: "▲";
  308. margin-right: .25em;
  309. color: var(--c-txt-alt2);
  310. }
  311. }
  312. figure.left {
  313. float: left;
  314. margin-right: 1em;
  315. max-width: 40%;
  316. text-align: left;
  317. }
  318. figure.right {
  319. float: right;
  320. margin-left: 1em;
  321. max-width: 40%;
  322. text-align: right;
  323. }
  324. img {
  325. display: inline-block;
  326. max-width: 100%;
  327. height: auto;
  328. margin: auto;
  329. }
  330. video,
  331. iframe {
  332. max-width: 100%;
  333. height: auto;
  334. }
  335. }
  336. // single.html
  337. //
  338. .toc-wrapper {
  339. padding: .5rem;
  340. margin: 1em 0;
  341. border: 1px dashed var(--c-bg-alt);
  342. font-size: 90%;
  343. }
  344. .footnotes {
  345. padding: .5rem .75rem;
  346. margin-top: 1.5rem;
  347. font-size: 80%;
  348. background: var(--c-bg-alt);
  349. &::before {
  350. content: "Footnotes";
  351. font-weight: bold;
  352. font-style: italic;
  353. }
  354. hr {
  355. display: none;
  356. }
  357. ol,
  358. p {
  359. margin: 0;
  360. }
  361. }
  362. a.footnote-backref {
  363. text-decoration: none;
  364. }
  365. a.footnote-ref {
  366. font-size: 80%;
  367. text-decoration: none;
  368. &::before {
  369. content: "[";
  370. }
  371. &::after {
  372. content: "]";
  373. }
  374. &:hover {
  375. color: $accent;
  376. }
  377. }
  378. .post-footer {
  379. margin-top: 3rem;
  380. font-size: 90%;
  381. .post-item {
  382. padding: 0;
  383. }
  384. }
  385. // list.html
  386. //
  387. .section {
  388. max-width: 48em;
  389. margin: 1.5rem auto 0;
  390. }
  391. .section-title {
  392. display: flex;
  393. justify-content: space-between;
  394. align-items: center;
  395. color: var(--c-txt-alt);
  396. h2 {
  397. margin: 0;
  398. }
  399. span {
  400. font-size: 120%;
  401. }
  402. }
  403. .post-item {
  404. display: flex;
  405. align-items: center;
  406. gap: .5em;
  407. padding: .25em 0;
  408. time {
  409. flex-shrink: 0;
  410. }
  411. }
  412. .dotted-line {
  413. flex: 1;
  414. border-top: 2px dotted var(--c-bg-alt);
  415. }
  416. .album-row {
  417. display: flex;
  418. flex-wrap: wrap;
  419. gap: .5em;
  420. margin-top: .5em;
  421. }
  422. .img-tile {
  423. height: 100px;
  424. width: auto;
  425. max-width: 100%;
  426. object-fit: cover;
  427. }
  428. .home-photo-group {
  429. display: flex;
  430. gap: .5em;
  431. overflow-x: hidden;
  432. }
  433. .home-photo-item {
  434. max-height: 50px;
  435. width: auto;
  436. }
  437. @import "syntax.scss", "partials/comments";
  438. @media all and (min-width: 55em) {
  439. .site-header {
  440. grid-template-columns: 1fr 2fr 1fr;
  441. }
  442. .site-nav {
  443. display: block;
  444. }
  445. .site-main {
  446. margin-top: 2rem;
  447. }
  448. .site-footer {
  449. display: flex;
  450. justify-content: space-between;
  451. }
  452. }
  453. @media all and (min-width: 79em) {
  454. .site-main {
  455. margin-top: 5rem;
  456. }
  457. .page-title {
  458. max-width: 100%;
  459. margin-bottom: 2rem;
  460. text-align: center;
  461. }
  462. figure.big {
  463. width: 76rem;
  464. margin: 2rem 0 2rem -14rem;
  465. }
  466. figure.left {
  467. margin-left: -14rem;
  468. }
  469. figure.right {
  470. margin-right: -14rem;
  471. }
  472. }