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: #1e1f20;
  46. --c-bg-alt: #313a3f;
  47. --c-txt: #adadad;
  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. margin-top: 2rem;
  230. border: none;
  231. text-align: center;
  232. color: var(--c-bg-alt);
  233. &::after {
  234. content: "* * *";
  235. display: block;
  236. font-size: 1.5rem;
  237. }
  238. }
  239. button,
  240. [type=button],
  241. [type=reset],
  242. [type=submit] {
  243. border: 1px solid var(--c-txt-alt);
  244. &:hover {
  245. border-color: $accent;
  246. }
  247. &:active {
  248. border-style: dashed;
  249. }
  250. }
  251. input[type=text],
  252. input[type=email],
  253. input[type=url] {
  254. width: 100%;
  255. border: 1px solid var(--c-txt-alt);
  256. border-width: 0 0 1px 0;
  257. background-color: transparent;
  258. }
  259. textarea {
  260. width: 100%;
  261. max-width: 100%;
  262. padding: 2px 6px;
  263. border: 1px solid var(--c-txt-alt);
  264. background-color: transparent;
  265. }
  266. .feather {
  267. display: inline-block;
  268. vertical-align: -.125em;
  269. width: 1em;
  270. height: 1em;
  271. }
  272. .content {
  273. text-justify: inter-ideograph; //For IE/Edge
  274. overflow-wrap: break-word;
  275. figure {
  276. height: auto;
  277. margin: 0;
  278. text-align: center;
  279. }
  280. figcaption>p {
  281. margin-top: .1rem;
  282. margin-bottom: 1rem;
  283. font-size: 75%;
  284. font-style: italic;
  285. color: var(--c-txt-alt);
  286. }
  287. figure.left {
  288. float: left;
  289. margin-right: 1em;
  290. max-width: 40%;
  291. text-align: left;
  292. }
  293. figure.right {
  294. float: right;
  295. margin-left: 1em;
  296. max-width: 40%;
  297. text-align: right;
  298. }
  299. img {
  300. display: inline-block;
  301. max-width: 100%;
  302. height: auto;
  303. margin: auto;
  304. }
  305. video,
  306. iframe {
  307. max-width: 100%;
  308. height: auto;
  309. }
  310. }
  311. .post-info {
  312. margin-top: -2.25rem;
  313. margin-bottom: 1.5rem;
  314. line-height: normal;
  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. p {
  345. margin: 0;
  346. }
  347. hr::after {
  348. content: "# FOOTNOTES #";
  349. font-size: 1rem;
  350. }
  351. }
  352. a.footnote-backref {
  353. text-decoration: none;
  354. }
  355. a.footnote-ref {
  356. padding: 1px 2px;
  357. line-height: normal;
  358. font-size: 80%;
  359. border-radius: 2px;
  360. text-decoration: none;
  361. background-color: var(--c-bg-alt);
  362. transition-property: background-color;
  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. }