style.scss 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  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. margin: 0;
  20. padding: 1rem;
  21. line-height: 1.6;
  22. letter-spacing: .04rem;
  23. >main {
  24. margin-bottom: 4rem;
  25. }
  26. >section,
  27. >nav,
  28. >footer {
  29. margin-block: 4rem;
  30. }
  31. }
  32. body,
  33. button,
  34. input,
  35. select,
  36. textarea {
  37. color: var(--c-txt);
  38. background-color: var(--c-bg);
  39. font-family: $fonts-sans;
  40. transition: color .5s, background-color .5s, border-color .5s;
  41. }
  42. // Auto light/dark mode
  43. @media (prefers-color-scheme: dark) {
  44. body {
  45. --c-bg: #1b1f23;
  46. --c-bg-alt: #313a3f;
  47. --c-txt: #bababa;
  48. --c-txt-alt: #898680;
  49. --c-txt-alt2: rgba(140, 140, 140, .5);
  50. --c-txt-em: #dedede;
  51. }
  52. main img {
  53. filter: brightness(.9);
  54. transition: filter .3s;
  55. &:hover {
  56. filter: none;
  57. }
  58. }
  59. }
  60. // Layouts
  61. //
  62. .wrapper {
  63. max-width: 48rem;
  64. margin-inline: auto;
  65. }
  66. h1 {
  67. margin-top: 2rem;
  68. margin-bottom: 2.5rem;
  69. line-height: 1.25;
  70. font-size: 1.75em;
  71. }
  72. #home-social a {
  73. margin-right: 1rem;
  74. }
  75. .recent-posts-list {
  76. li {
  77. margin-top: .125rem;
  78. }
  79. span {
  80. color: var(--c-txt-alt);
  81. font-size: 75%;
  82. font-style: italic;
  83. &::before {
  84. content: "/ ";
  85. color: var(--c-txt-alt2);
  86. }
  87. }
  88. }
  89. .site-nav {
  90. li {
  91. margin-top: .125rem;
  92. }
  93. a {
  94. display: block;
  95. }
  96. }
  97. .site-footer {
  98. font-size: 75%;
  99. }
  100. // Global style
  101. //
  102. h1,
  103. h2,
  104. h3,
  105. h4,
  106. h5,
  107. h6 {
  108. font-weight: bold;
  109. font-family: var(--fonts-serif);
  110. color: var(--c-txt-em);
  111. }
  112. ul,
  113. ol {
  114. padding-inline-start: 2em;
  115. }
  116. // lsn -> list-style: none
  117. ul.lsn {
  118. list-style: none;
  119. padding-inline-start: 0;
  120. }
  121. // lsc -> list-style: circle
  122. ul.lsc {
  123. list-style: circle;
  124. }
  125. // tdln -> text-decoration-line: none
  126. a.tdln,
  127. .tdln a {
  128. text-decoration-line: none;
  129. }
  130. .dim {
  131. color: var(--c-txt-alt)
  132. }
  133. .dimmer {
  134. color: var(--c-txt-alt2)
  135. }
  136. a {
  137. color: var(--c-txt);
  138. text-decoration-color: var(--c-txt-alt2);
  139. text-decoration-thickness: 1px;
  140. text-underline-offset: 0.25em;
  141. transition: color .3s, text-decoration-color .3s, border-color .3s;
  142. &:hover {
  143. color: $accent;
  144. text-decoration-color: $accent;
  145. }
  146. &:active {
  147. text-decoration-style: dashed;
  148. }
  149. &.home {
  150. position: absolute;
  151. line-height: 1;
  152. font-size: 75%;
  153. font-style: italic;
  154. text-decoration: none;
  155. color: var(--c-txt-alt);
  156. &:hover {
  157. color: $accent;
  158. }
  159. }
  160. }
  161. pre,
  162. code,
  163. pre tt {
  164. font-family: var(--fonts-mono);
  165. letter-spacing: normal;
  166. }
  167. pre {
  168. padding: .7em 1.1em;
  169. overflow: auto;
  170. font-size: 90%;
  171. line-height: 1.2;
  172. white-space: pre;
  173. background-color: var(--c-bg-alt);
  174. code {
  175. padding: 0;
  176. margin: 0;
  177. background: transparent;
  178. }
  179. }
  180. code {
  181. background: var(--c-bg-alt);
  182. padding: 0 3px;
  183. margin: 0 2px;
  184. }
  185. blockquote {
  186. margin: 1.5em 1em;
  187. font-style: italic;
  188. font-family: var(--fonts-serif);
  189. font-size: 125%;
  190. letter-spacing: normal;
  191. color: var(--c-txt-alt);
  192. &::before {
  193. content: "“";
  194. position: absolute;
  195. z-index: -1;
  196. line-height: 1;
  197. font-size: 5rem;
  198. transform: translate(-1rem, -1rem);
  199. color: var(--c-bg-alt);
  200. }
  201. p {
  202. margin-left: 1.5em;
  203. }
  204. cite {
  205. font-weight: bold;
  206. font-style: normal;
  207. font-size: 75%;
  208. &::before {
  209. content: "― ";
  210. }
  211. }
  212. }
  213. table {
  214. border-collapse: collapse;
  215. border-spacing: 0;
  216. empty-cells: show;
  217. width: 100%;
  218. max-width: 100%;
  219. th,
  220. td {
  221. padding: 1.5%;
  222. border: 1px solid;
  223. }
  224. th {
  225. font-weight: bold;
  226. vertical-align: bottom;
  227. }
  228. }
  229. hr {
  230. width: auto;
  231. height: 2rem;
  232. border: none;
  233. text-align: center;
  234. color: var(--c-bg-alt);
  235. &::after {
  236. content: "* * *";
  237. display: block;
  238. font-size: 1.5rem;
  239. }
  240. }
  241. button,
  242. [type=button],
  243. [type=reset],
  244. [type=submit] {
  245. border: 1px solid var(--c-txt-alt);
  246. &:hover {
  247. border-color: $accent;
  248. }
  249. &:active {
  250. border-style: dashed;
  251. }
  252. }
  253. input[type=text],
  254. input[type=email],
  255. input[type=url] {
  256. width: 100%;
  257. border: 1px solid var(--c-txt-alt);
  258. border-width: 0 0 1px 0;
  259. background-color: transparent;
  260. }
  261. textarea {
  262. width: 100%;
  263. max-width: 100%;
  264. padding: 2px 6px;
  265. border: 1px solid var(--c-txt-alt);
  266. background-color: transparent;
  267. }
  268. .feather {
  269. display: inline-block;
  270. vertical-align: -.125em;
  271. width: 1em;
  272. height: 1em;
  273. }
  274. .content {
  275. text-justify: inter-ideograph; //For IE/Edge
  276. overflow-wrap: break-word;
  277. figure {
  278. height: auto;
  279. margin: 0;
  280. text-align: center;
  281. }
  282. figcaption>p {
  283. margin-top: .1rem;
  284. margin-bottom: 1rem;
  285. font-size: 75%;
  286. font-style: italic;
  287. color: var(--c-txt-alt);
  288. }
  289. figure.left {
  290. float: left;
  291. margin-right: 1em;
  292. max-width: 40%;
  293. text-align: left;
  294. }
  295. figure.right {
  296. float: right;
  297. margin-left: 1em;
  298. max-width: 40%;
  299. text-align: right;
  300. }
  301. img {
  302. display: inline-block;
  303. max-width: 100%;
  304. height: auto;
  305. margin: auto;
  306. }
  307. video,
  308. iframe {
  309. max-width: 100%;
  310. height: auto;
  311. }
  312. }
  313. .post-info {
  314. margin-top: -2.25rem;
  315. margin-bottom: 1.5rem;
  316. font-size: 90%;
  317. color: var(--c-txt-alt);
  318. label {
  319. cursor: pointer;
  320. }
  321. }
  322. #toc-toggle {
  323. display: none;
  324. }
  325. #toc {
  326. display: none;
  327. margin-top: .75rem;
  328. border-top: 1px dashed var(--c-bg-alt);
  329. border-bottom: 1px dashed var(--c-bg-alt);
  330. font-style: italic;
  331. a {
  332. display: block;
  333. color: var(--c-txt-alt);
  334. text-decoration: none;
  335. &:hover {
  336. color: $accent;
  337. }
  338. }
  339. }
  340. #toc-toggle:checked+#toc {
  341. display: block;
  342. }
  343. .footnotes {
  344. font-size: 80%;
  345. margin-top: 2rem;
  346. p {
  347. margin: 0;
  348. }
  349. hr::after {
  350. content: "# FOOTNOTES #";
  351. font-size: 1rem;
  352. }
  353. }
  354. a.footnote-backref {
  355. text-decoration: none;
  356. }
  357. a.footnote-ref {
  358. font-size: 80%;
  359. text-decoration: none;
  360. &::before {
  361. content: "[";
  362. }
  363. &::after {
  364. content: "]";
  365. }
  366. &:hover {
  367. color: $accent;
  368. }
  369. }
  370. .post-footer {
  371. margin-top: 3rem;
  372. font-size: 75%;
  373. }
  374. .post-tag {
  375. margin-right: .5em;
  376. margin-bottom: .5rem;
  377. &::before {
  378. content: "#";
  379. }
  380. }
  381. .post-group {
  382. margin-top: 2rem;
  383. padding-left: 2px;
  384. }
  385. .post-year {
  386. margin-bottom: .5rem;
  387. font-weight: bold;
  388. letter-spacing: .125em;
  389. }
  390. .post-list {
  391. margin: 0;
  392. }
  393. .post-item {
  394. display: flex;
  395. margin-bottom: .25rem;
  396. }
  397. .post-day {
  398. display: inline-block;
  399. min-width: 4em;
  400. }
  401. @import "partials/comments", "partials/gallery";
  402. @media all and (min-width: 550px) {
  403. .post-group {
  404. display: flex;
  405. gap: 1.5rem;
  406. }
  407. }
  408. @media all and (min-width: 880px) {
  409. h1 {
  410. margin-top: 5rem;
  411. font-size: 2em;
  412. }
  413. }
  414. @media all and (min-width: 1300px) {
  415. h1 {
  416. margin-top: 8rem;
  417. }
  418. figure.big {
  419. width: 70rem;
  420. margin-left: -10rem;
  421. margin-block: 3rem;
  422. }
  423. figure.left {
  424. margin-left: -10rem;
  425. }
  426. figure.right {
  427. margin-right: -10rem;
  428. }
  429. }