style.scss 6.8 KB

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