style.scss 5.8 KB

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