style.scss 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. @import "predefined.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. --c-bg: #f3f6f6;
  41. --c-bg-alt: #dee8e5;
  42. --c-txt: #545250;
  43. --c-txt-alt: #72706e;
  44. --c-txt-alt2: rgba(114, 112, 110, .3);
  45. --c-txt-em: #333333;
  46. }
  47. body {
  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. html {
  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. display: inline-block;
  300. width: 100%;
  301. font-size: 125%;
  302. }
  303. h1 {
  304. margin: 0 0 .25rem;
  305. font-size: 162.5%;
  306. line-height: 1.4;
  307. }
  308. .site-title {
  309. margin-top: .5rem;
  310. }
  311. .section {
  312. margin-top: 1.5rem;
  313. }
  314. .section-title {
  315. display: flex;
  316. justify-content: space-between;
  317. align-items: center;
  318. border-bottom: 1px dashed var(--c-bg-alt);
  319. h2 {
  320. margin: 0;
  321. }
  322. >object {
  323. text-align: right;
  324. >a {
  325. display: block;
  326. }
  327. }
  328. }
  329. a.section-title:hover {
  330. border-color: $accent;
  331. }
  332. .post-item {
  333. display: flex;
  334. justify-content: space-between;
  335. align-items: center;
  336. gap: 1rem;
  337. padding: .375em 0;
  338. border-bottom: 1px dashed var(--c-bg-alt);
  339. transition: border-color .3s;
  340. &:hover {
  341. border-color: $accent;
  342. }
  343. }
  344. .post-title {
  345. flex: 1;
  346. }
  347. .home-photo-group {
  348. display: flex;
  349. gap: .5em;
  350. overflow-x: hidden;
  351. flex-grow: 1;
  352. &::after {
  353. content: "";
  354. display: block;
  355. flex-grow: 1;
  356. }
  357. .home-photo-item {
  358. max-height: 50px;
  359. width: auto;
  360. }
  361. }
  362. .site-footer {
  363. padding-top: .5rem;
  364. margin-top: 3rem;
  365. border-top: 2px solid var(--c-bg-alt);
  366. font-size: 80%;
  367. }
  368. .description {
  369. font-size: 75%;
  370. font-style: italic;
  371. }
  372. .post-info {
  373. width: 14rem;
  374. max-width: 100%;
  375. padding-top: .5em;
  376. margin-bottom: 1em;
  377. font-size: 75%;
  378. border-top: 2px solid var(--c-bg-alt);
  379. }
  380. .post-tag {
  381. margin-right: .5em;
  382. margin-bottom: .5rem;
  383. &::before {
  384. content: "#";
  385. }
  386. }
  387. .content {
  388. text-justify: inter-ideograph; //For IE/Edge
  389. overflow-wrap: break-word;
  390. figure {
  391. height: auto;
  392. margin: 0 0 .25rem;
  393. text-align: center;
  394. }
  395. figcaption>p {
  396. margin: 0;
  397. font-size: 75%;
  398. color: var(--c-txt-alt);
  399. &::before {
  400. content: "▲";
  401. margin-right: .25em;
  402. color: var(--c-txt-alt2);
  403. }
  404. }
  405. figure.left {
  406. float: left;
  407. margin-right: 1em;
  408. max-width: 40%;
  409. text-align: left;
  410. }
  411. figure.right {
  412. float: right;
  413. margin-left: 1em;
  414. max-width: 40%;
  415. text-align: right;
  416. }
  417. img {
  418. display: inline-block;
  419. max-width: 100%;
  420. height: auto;
  421. margin: auto;
  422. }
  423. video,
  424. iframe {
  425. max-width: 100%;
  426. height: auto;
  427. }
  428. }
  429. .footnotes {
  430. font-size: 80%;
  431. margin-top: 1.5rem;
  432. p {
  433. margin: 0;
  434. }
  435. hr::after {
  436. content: "# FOOTNOTES #";
  437. font-size: 1rem;
  438. }
  439. }
  440. a.footnote-backref {
  441. text-decoration: none;
  442. }
  443. a.footnote-ref {
  444. font-size: 80%;
  445. text-decoration: none;
  446. &::before {
  447. content: "[";
  448. }
  449. &::after {
  450. content: "]";
  451. }
  452. &:hover {
  453. color: $accent;
  454. }
  455. }
  456. .post-footer {
  457. margin-top: 3rem;
  458. font-size: 80%;
  459. }
  460. // list.html for Photo section
  461. //
  462. .album-row {
  463. display: flex;
  464. flex-wrap: wrap;
  465. gap: .5em;
  466. margin-top: .5em;
  467. }
  468. .img-tile {
  469. height: 100px;
  470. width: auto;
  471. max-width: 100%;
  472. object-fit: cover;
  473. }
  474. @import "syntax.scss", "partials/comments";
  475. @media all and (min-width: 55em) {
  476. body {
  477. padding-top: 3rem;
  478. }
  479. }
  480. @media all and (min-width: 81em) {
  481. body {
  482. padding-top: 5rem;
  483. }
  484. .back-btn {
  485. display: none;
  486. }
  487. .site-title {
  488. margin-top: 0;
  489. }
  490. .site-header {
  491. display: block;
  492. flex-basis: 14rem;
  493. }
  494. .header-inner {
  495. position: sticky;
  496. top: 1rem;
  497. }
  498. .wrapper {
  499. flex-basis: 63rem;
  500. max-width: 63rem;
  501. margin: 0;
  502. }
  503. .content>* {
  504. max-width: 48rem;
  505. }
  506. .content>figure.big {
  507. max-width: 100%;
  508. margin: 1rem 0;
  509. text-align: left;
  510. }
  511. .content>.highlight,
  512. .content>pre,
  513. .content>table {
  514. max-width: 100%;
  515. }
  516. .post-info.writing {
  517. float: right;
  518. padding-top: 0;
  519. border-top: none;
  520. border-left: 2px solid var(--c-bg-alt);
  521. >li {
  522. padding-left: 1em;
  523. }
  524. }
  525. }