style.scss 7.9 KB

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