style.scss 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  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: 3.5rem;
  25. }
  26. >section,
  27. >nav,
  28. >footer {
  29. margin-block: 3.5rem;
  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-block: 1.5rem;
  68. line-height: 1.4;
  69. font-size: 1.75em;
  70. }
  71. #home-social a {
  72. margin-right: 1rem;
  73. }
  74. .recent-posts-list {
  75. li {
  76. margin-top: .125rem;
  77. }
  78. span {
  79. color: var(--c-txt-alt);
  80. font-size: 75%;
  81. font-style: italic;
  82. &::before {
  83. content: "/ ";
  84. color: var(--c-txt-alt2);
  85. }
  86. }
  87. }
  88. .site-nav {
  89. li {
  90. margin-top: .125rem;
  91. }
  92. a {
  93. display: block;
  94. }
  95. }
  96. .site-footer {
  97. font-size: 75%;
  98. }
  99. // Global style
  100. //
  101. h1,
  102. h2,
  103. h3,
  104. h4,
  105. h5,
  106. h6 {
  107. font-weight: bold;
  108. font-family: var(--fonts-serif);
  109. color: var(--c-txt-em);
  110. }
  111. ul,
  112. ol {
  113. padding-inline-start: 1.25em;
  114. }
  115. li::marker {
  116. font-size: 90%;
  117. color: var(--c-txt-alt);
  118. letter-spacing: normal;
  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: italic 125% var(--fonts-serif);
  192. letter-spacing: normal;
  193. color: var(--c-txt-alt);
  194. &::before {
  195. content: "“";
  196. position: absolute;
  197. z-index: -1;
  198. line-height: 1;
  199. font-size: 5rem;
  200. transform: translate(-1rem, -1rem);
  201. color: var(--c-bg-alt);
  202. }
  203. p {
  204. margin-left: 1.5em;
  205. }
  206. cite {
  207. font-weight: bold;
  208. font-style: normal;
  209. font-size: 75%;
  210. &::before {
  211. content: "― ";
  212. }
  213. }
  214. }
  215. table {
  216. border-collapse: collapse;
  217. border-spacing: 0;
  218. empty-cells: show;
  219. width: 100%;
  220. max-width: 100%;
  221. th,
  222. td {
  223. padding: 1.5%;
  224. border: 1px solid var(--c-txt-alt2);
  225. }
  226. th {
  227. font-weight: bold;
  228. vertical-align: bottom;
  229. background-color: var(--c-bg-alt);
  230. }
  231. }
  232. hr {
  233. width: auto;
  234. height: 2rem;
  235. border: none;
  236. text-align: center;
  237. color: var(--c-txt-alt2);
  238. &::after {
  239. content: "* * *";
  240. display: block;
  241. font-size: 1.5rem;
  242. }
  243. }
  244. button,
  245. [type=button],
  246. [type=reset],
  247. [type=submit] {
  248. border: 1px solid var(--c-txt-alt);
  249. &:hover {
  250. border-color: $accent;
  251. }
  252. &:active {
  253. border-style: dashed;
  254. }
  255. }
  256. input[type=text],
  257. input[type=email],
  258. input[type=url] {
  259. width: 100%;
  260. border: 1px solid var(--c-txt-alt);
  261. border-width: 0 0 1px 0;
  262. background-color: transparent;
  263. }
  264. textarea {
  265. width: 100%;
  266. max-width: 100%;
  267. padding: 2px 6px;
  268. border: 1px solid var(--c-txt-alt);
  269. background-color: transparent;
  270. }
  271. .feather {
  272. display: inline-block;
  273. vertical-align: -.125em;
  274. width: 1em;
  275. height: 1em;
  276. }
  277. .content {
  278. text-justify: inter-ideograph; //For IE/Edge
  279. overflow-wrap: break-word;
  280. figure {
  281. height: auto;
  282. margin: 0;
  283. text-align: center;
  284. }
  285. figcaption>p {
  286. margin-top: .1rem;
  287. margin-bottom: 1rem;
  288. font-size: 75%;
  289. font-style: italic;
  290. color: var(--c-txt-alt);
  291. }
  292. figure.left {
  293. float: left;
  294. margin-right: 1em;
  295. max-width: 40%;
  296. text-align: left;
  297. }
  298. figure.right {
  299. float: right;
  300. margin-left: 1em;
  301. max-width: 40%;
  302. text-align: right;
  303. }
  304. img {
  305. display: inline-block;
  306. max-width: 100%;
  307. height: auto;
  308. margin: auto;
  309. }
  310. video,
  311. iframe {
  312. max-width: 100%;
  313. height: auto;
  314. }
  315. }
  316. .post-info {
  317. margin-top: -1.25rem;
  318. margin-bottom: 1rem;
  319. font-size: 90%;
  320. label {
  321. cursor: pointer;
  322. }
  323. }
  324. #toc-toggle {
  325. display: none;
  326. }
  327. #toc {
  328. display: none;
  329. margin-top: .75rem;
  330. border-top: 1px dashed var(--c-bg-alt);
  331. border-bottom: 1px dashed var(--c-bg-alt);
  332. font-style: italic;
  333. a {
  334. display: block;
  335. color: var(--c-txt-alt);
  336. text-decoration: none;
  337. &:hover {
  338. color: $accent;
  339. }
  340. }
  341. }
  342. #toc-toggle:checked+#toc {
  343. display: block;
  344. }
  345. .footnotes {
  346. font-size: 80%;
  347. margin-top: 2rem;
  348. p {
  349. margin: 0;
  350. }
  351. hr::after {
  352. content: "# FOOTNOTES #";
  353. font-size: 1rem;
  354. }
  355. }
  356. a.footnote-backref {
  357. text-decoration: none;
  358. }
  359. a.footnote-ref {
  360. font-size: 80%;
  361. text-decoration: none;
  362. &::before {
  363. content: "[";
  364. }
  365. &::after {
  366. content: "]";
  367. }
  368. &:hover {
  369. color: $accent;
  370. }
  371. }
  372. .post-footer {
  373. margin-top: 3rem;
  374. font-size: 80%;
  375. }
  376. .post-tag {
  377. margin-right: .5em;
  378. margin-bottom: .5rem;
  379. &::before {
  380. content: "#";
  381. }
  382. }
  383. .post-group {
  384. margin-top: 2rem;
  385. padding-left: 2px;
  386. }
  387. .post-year {
  388. margin-bottom: .5rem;
  389. font-weight: bold;
  390. letter-spacing: .125em;
  391. }
  392. .post-list {
  393. margin: 0;
  394. }
  395. .post-item {
  396. display: flex;
  397. margin-bottom: .25rem;
  398. }
  399. .post-day {
  400. display: inline-block;
  401. min-width: 4em;
  402. }
  403. @import "partials/comments", "partials/gallery";
  404. @media all and (min-width: 550px) {
  405. .post-group {
  406. display: flex;
  407. gap: 1.5rem;
  408. }
  409. }
  410. @media all and (min-width: 880px) {
  411. h1 {
  412. margin-top: 4rem;
  413. font-size: 2em;
  414. }
  415. a.anchor {
  416. float: left;
  417. margin-left: -.75em;
  418. }
  419. }
  420. @media all and (min-width: 1300px) {
  421. h1 {
  422. margin-top: 8rem;
  423. }
  424. figure.big {
  425. width: 70rem;
  426. margin-left: -10rem;
  427. margin-block: 3rem;
  428. }
  429. figure.left {
  430. margin-left: -10rem;
  431. }
  432. figure.right {
  433. margin-right: -10rem;
  434. }
  435. }