style.scss 5.7 KB

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