style.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  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. width: 100%;
  223. margin: auto;
  224. display: flex;
  225. flex-direction: column;
  226. flex-grow: 1;
  227. >main {
  228. flex-grow: 1;
  229. }
  230. }
  231. body>header {
  232. display: none;
  233. border-right: 2px solid var(--c-bg-alt);
  234. color: var(--c-txt-alt);
  235. a {
  236. text-decoration: none;
  237. }
  238. }
  239. .site-nav {
  240. margin: 0 0 2em;
  241. padding-right: 1rem;
  242. a {
  243. display: block;
  244. padding: .25em 0;
  245. border-bottom: 1px dotted var(--c-bg-alt);
  246. }
  247. }
  248. .active {
  249. &::after {
  250. content: '※';
  251. float: right;
  252. margin-left: 1em;
  253. color: var(--c-txt-alt2);
  254. }
  255. }
  256. #TableOfContents {
  257. margin-top: -.75em;
  258. font-size: 90%;
  259. ul {
  260. padding-right: 1rem;
  261. }
  262. a {
  263. display: block;
  264. }
  265. }
  266. .back-btn {
  267. font-size: 125%;
  268. }
  269. h1 {
  270. margin: 0 0 .25rem;
  271. font-size: 162.5%;
  272. line-height: 1.4;
  273. }
  274. .section {
  275. margin-top: 2rem;
  276. }
  277. .section-title {
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. padding-bottom: .25rem;
  282. border-bottom: 1px dashed var(--c-bg-alt);
  283. h2 {
  284. margin: 0;
  285. }
  286. >object {
  287. text-align: right;
  288. >a {
  289. display: block;
  290. }
  291. }
  292. }
  293. a.section-title:hover {
  294. border-color: $accent;
  295. }
  296. .post-item {
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. gap: 1rem;
  301. padding: .5em 0;
  302. border-bottom: 1px dashed var(--c-bg-alt);
  303. transition: border-color .3s;
  304. &:hover {
  305. border-color: $accent;
  306. }
  307. }
  308. .post-title {
  309. flex: 1;
  310. }
  311. .home-photo-group {
  312. display: flex;
  313. gap: .5em;
  314. overflow-x: hidden;
  315. height: 50px;
  316. flex-grow: 1;
  317. &::after {
  318. content: "";
  319. display: block;
  320. flex-grow: 1;
  321. }
  322. .home-photo-item {
  323. max-height: 50px;
  324. width: auto;
  325. }
  326. }
  327. .site-footer {
  328. padding-top: .5rem;
  329. margin-top: 3rem;
  330. border-top: 2px solid var(--c-bg-alt);
  331. font-size: 80%;
  332. }
  333. .description {
  334. font-size: 75%;
  335. font-style: italic;
  336. }
  337. .post-info {
  338. width: 14rem;
  339. max-width: 100%;
  340. padding-top: .5em;
  341. margin-bottom: 1em;
  342. font-size: 75%;
  343. border-top: 2px solid var(--c-bg-alt);
  344. }
  345. .post-tag {
  346. margin-right: .5em;
  347. margin-bottom: .5rem;
  348. &::before {
  349. content: "#";
  350. }
  351. }
  352. .content {
  353. text-justify: inter-ideograph; //For IE/Edge
  354. overflow-wrap: break-word;
  355. figure {
  356. height: auto;
  357. margin: 0 0 .25rem;
  358. text-align: center;
  359. }
  360. figcaption>p {
  361. margin: 0;
  362. font-size: 75%;
  363. font-weight: bold;
  364. color: var(--c-txt-alt);
  365. &::before {
  366. content: "↑";
  367. margin-right: .25em;
  368. color: var(--c-txt-alt2);
  369. }
  370. }
  371. figure.left {
  372. float: left;
  373. margin-right: 1em;
  374. max-width: 40%;
  375. text-align: left;
  376. }
  377. figure.right {
  378. float: right;
  379. margin-left: 1em;
  380. max-width: 40%;
  381. text-align: right;
  382. }
  383. img {
  384. display: inline-block;
  385. max-width: 100%;
  386. height: auto;
  387. margin: auto;
  388. }
  389. video,
  390. iframe {
  391. max-width: 100%;
  392. height: auto;
  393. }
  394. }
  395. .footnotes {
  396. font-size: 80%;
  397. margin-top: 1.5rem;
  398. p {
  399. margin: 0;
  400. }
  401. hr::after {
  402. content: "# FOOTNOTES #";
  403. font-size: 1rem;
  404. }
  405. }
  406. a.footnote-backref {
  407. text-decoration: none;
  408. }
  409. a.footnote-ref {
  410. font-size: 80%;
  411. text-decoration: none;
  412. &::before {
  413. content: "[";
  414. }
  415. &::after {
  416. content: "]";
  417. }
  418. &:hover {
  419. color: $accent;
  420. }
  421. }
  422. .post-footer {
  423. margin-top: 3rem;
  424. font-size: 80%;
  425. }
  426. // list.html for Photo section
  427. //
  428. .album-row {
  429. display: flex;
  430. flex-wrap: wrap;
  431. gap: .5em;
  432. margin-top: .5em;
  433. }
  434. .img-tile {
  435. height: 100px;
  436. width: auto;
  437. max-width: 100%;
  438. object-fit: cover;
  439. }
  440. @import "partials/comments";
  441. @media all and (min-width: 34em) {}
  442. @media all and (min-width: 55em) {
  443. body {
  444. padding-top: 3rem;
  445. }
  446. }
  447. @media all and (min-width: 81em) {
  448. .back-btn {
  449. display: none;
  450. }
  451. body>header {
  452. display: block;
  453. flex-basis: 14rem;
  454. }
  455. .header-inner {
  456. position: sticky;
  457. top: 1rem;
  458. }
  459. .wrapper {
  460. flex-basis: 63rem;
  461. max-width: 63rem;
  462. margin: 0;
  463. }
  464. .content>* {
  465. max-width: 48rem;
  466. }
  467. .content>figure.big {
  468. max-width: 100%;
  469. margin: 1rem 0;
  470. text-align: left;
  471. }
  472. .content>.highlight,
  473. .content>pre,
  474. .content>table {
  475. max-width: 100%;
  476. }
  477. .post-info.writing {
  478. float: right;
  479. padding-top: 0;
  480. border-top: none;
  481. border-left: 2px solid var(--c-bg-alt);
  482. >li {
  483. padding-left: 1em;
  484. }
  485. }
  486. }