style.scss 6.9 KB

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