style.scss 8.5 KB

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