style.scss 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  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.7;
  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: #8f8f8f;
  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.4;
  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. li::marker {
  117. font-size: 90%;
  118. color: var(--c-txt-alt2);
  119. }
  120. // lsn -> list-style: none
  121. ul.lsn {
  122. list-style: none;
  123. padding-inline-start: 0;
  124. }
  125. // lsc -> list-style: circle
  126. ul.lsc {
  127. list-style: circle;
  128. }
  129. // tdln -> text-decoration-line: none
  130. a.tdln,
  131. .tdln a {
  132. text-decoration-line: none;
  133. }
  134. .dim {
  135. color: var(--c-txt-alt)
  136. }
  137. .dimmer {
  138. color: var(--c-txt-alt2)
  139. }
  140. a {
  141. color: var(--c-txt);
  142. text-decoration-color: var(--c-txt-alt2);
  143. text-decoration-thickness: 1px;
  144. text-underline-offset: 0.25em;
  145. transition: color .3s, text-decoration-color .3s, border-color .3s;
  146. &:hover {
  147. color: $accent;
  148. text-decoration-color: $accent;
  149. }
  150. &:active {
  151. text-decoration-style: dashed;
  152. }
  153. &.home {
  154. position: absolute;
  155. line-height: 1;
  156. font-size: 75%;
  157. font-style: italic;
  158. text-decoration: none;
  159. color: var(--c-txt-alt);
  160. &:hover {
  161. color: $accent;
  162. }
  163. }
  164. }
  165. pre,
  166. code,
  167. pre tt {
  168. font-family: var(--fonts-mono);
  169. letter-spacing: normal;
  170. }
  171. pre {
  172. padding: .7em 1.1em;
  173. overflow: auto;
  174. font-size: 90%;
  175. line-height: 1.2;
  176. white-space: pre;
  177. background-color: var(--c-bg-alt);
  178. code {
  179. padding: 0;
  180. margin: 0;
  181. background: transparent;
  182. }
  183. }
  184. code {
  185. background: var(--c-bg-alt);
  186. padding: 0 3px;
  187. margin: 0 2px;
  188. }
  189. blockquote {
  190. margin: 1.5em 1em;
  191. font-style: italic;
  192. font-family: var(--fonts-serif);
  193. font-size: 125%;
  194. letter-spacing: normal;
  195. color: var(--c-txt-alt);
  196. &::before {
  197. content: "“";
  198. position: absolute;
  199. z-index: -1;
  200. line-height: 1;
  201. font-size: 5rem;
  202. transform: translate(-1rem, -1rem);
  203. color: var(--c-bg-alt);
  204. }
  205. p {
  206. margin-left: 1.5em;
  207. }
  208. cite {
  209. font-weight: bold;
  210. font-style: normal;
  211. font-size: 75%;
  212. &::before {
  213. content: "― ";
  214. }
  215. }
  216. }
  217. table {
  218. border-collapse: collapse;
  219. border-spacing: 0;
  220. empty-cells: show;
  221. width: 100%;
  222. max-width: 100%;
  223. th,
  224. td {
  225. padding: 1.5%;
  226. border: 1px solid var(--c-txt-alt2);
  227. }
  228. th {
  229. font-weight: bold;
  230. vertical-align: bottom;
  231. background-color: var(--c-bg-alt);
  232. }
  233. }
  234. hr {
  235. width: auto;
  236. height: 2rem;
  237. border: none;
  238. text-align: center;
  239. color: var(--c-bg-alt);
  240. &::after {
  241. content: "* * *";
  242. display: block;
  243. font-size: 1.5rem;
  244. }
  245. }
  246. button,
  247. [type=button],
  248. [type=reset],
  249. [type=submit] {
  250. border: 1px solid var(--c-txt-alt);
  251. &:hover {
  252. border-color: $accent;
  253. }
  254. &:active {
  255. border-style: dashed;
  256. }
  257. }
  258. input[type=text],
  259. input[type=email],
  260. input[type=url] {
  261. width: 100%;
  262. border: 1px solid var(--c-txt-alt);
  263. border-width: 0 0 1px 0;
  264. background-color: transparent;
  265. }
  266. textarea {
  267. width: 100%;
  268. max-width: 100%;
  269. padding: 2px 6px;
  270. border: 1px solid var(--c-txt-alt);
  271. background-color: transparent;
  272. }
  273. .feather {
  274. display: inline-block;
  275. vertical-align: -.125em;
  276. width: 1em;
  277. height: 1em;
  278. }
  279. .content {
  280. text-justify: inter-ideograph; //For IE/Edge
  281. overflow-wrap: break-word;
  282. figure {
  283. height: auto;
  284. margin: 0;
  285. text-align: center;
  286. }
  287. figcaption>p {
  288. margin-top: .1rem;
  289. margin-bottom: 1rem;
  290. font-size: 75%;
  291. font-style: italic;
  292. color: var(--c-txt-alt);
  293. }
  294. figure.left {
  295. float: left;
  296. margin-right: 1em;
  297. max-width: 40%;
  298. text-align: left;
  299. }
  300. figure.right {
  301. float: right;
  302. margin-left: 1em;
  303. max-width: 40%;
  304. text-align: right;
  305. }
  306. img {
  307. display: inline-block;
  308. max-width: 100%;
  309. height: auto;
  310. margin: auto;
  311. }
  312. video,
  313. iframe {
  314. max-width: 100%;
  315. height: auto;
  316. }
  317. }
  318. .post-info {
  319. margin-top: -2.25rem;
  320. margin-bottom: 1.5rem;
  321. font-size: 90%;
  322. label {
  323. cursor: pointer;
  324. }
  325. }
  326. #toc-toggle {
  327. display: none;
  328. }
  329. #toc {
  330. display: none;
  331. margin-top: .75rem;
  332. border-top: 1px dashed var(--c-bg-alt);
  333. border-bottom: 1px dashed var(--c-bg-alt);
  334. font-style: italic;
  335. a {
  336. display: block;
  337. color: var(--c-txt-alt);
  338. text-decoration: none;
  339. &:hover {
  340. color: $accent;
  341. }
  342. }
  343. }
  344. #toc-toggle:checked+#toc {
  345. display: block;
  346. }
  347. .footnotes {
  348. font-size: 80%;
  349. margin-top: 2rem;
  350. p {
  351. margin: 0;
  352. }
  353. hr::after {
  354. content: "# FOOTNOTES #";
  355. font-size: 1rem;
  356. }
  357. }
  358. a.footnote-backref {
  359. text-decoration: none;
  360. }
  361. a.footnote-ref {
  362. font-size: 80%;
  363. text-decoration: none;
  364. &::before {
  365. content: "[";
  366. }
  367. &::after {
  368. content: "]";
  369. }
  370. &:hover {
  371. color: $accent;
  372. }
  373. }
  374. .post-footer {
  375. margin-top: 3rem;
  376. font-size: 80%;
  377. }
  378. .post-tag {
  379. margin-right: .5em;
  380. margin-bottom: .5rem;
  381. &::before {
  382. content: "#";
  383. }
  384. }
  385. .post-group {
  386. margin-top: 2rem;
  387. padding-left: 2px;
  388. }
  389. .post-year {
  390. margin-bottom: .5rem;
  391. font-weight: bold;
  392. letter-spacing: .125em;
  393. }
  394. .post-list {
  395. margin: 0;
  396. }
  397. .post-item {
  398. display: flex;
  399. margin-bottom: .25rem;
  400. }
  401. .post-day {
  402. display: inline-block;
  403. min-width: 4em;
  404. }
  405. @import "partials/comments", "partials/gallery";
  406. @media all and (min-width: 550px) {
  407. .post-group {
  408. display: flex;
  409. gap: 1.5rem;
  410. }
  411. }
  412. @media all and (min-width: 880px) {
  413. h1 {
  414. margin-top: 4rem;
  415. font-size: 2em;
  416. }
  417. a.anchor {
  418. float: left;
  419. margin-left: -1em;
  420. }
  421. ul,
  422. ol {
  423. padding-inline-start: 0;
  424. }
  425. }
  426. @media all and (min-width: 1300px) {
  427. h1 {
  428. margin-top: 8rem;
  429. }
  430. figure.big {
  431. width: 70rem;
  432. margin-left: -10rem;
  433. margin-block: 3rem;
  434. }
  435. figure.left {
  436. margin-left: -10rem;
  437. }
  438. figure.right {
  439. margin-right: -10rem;
  440. }
  441. }