style.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. @import "predefined.scss", "modern-normalize.scss", "syntax.scss";
  2. :root {
  3. --offset: 0;
  4. --vw: 1vw;
  5. }
  6. html {
  7. scroll-behavior: smooth;
  8. font-size: 1rem;
  9. }
  10. body {
  11. --c-bg: #f3f6f6;
  12. --c-bg-alt: #dee8e5;
  13. --c-txt: #545250;
  14. --c-txt-alt: #6d6b69;
  15. }
  16. @media (prefers-color-scheme: dark) {
  17. body {
  18. --c-bg: #27343a;
  19. --c-bg-alt: #364045;
  20. --c-txt: #c8c6c4;
  21. --c-txt-alt: #a19f9d;
  22. }
  23. #page img {
  24. filter: brightness(.9);
  25. }
  26. }
  27. body,
  28. button,
  29. input,
  30. select,
  31. textarea {
  32. color: var(--c-txt);
  33. background-color: var(--c-bg);
  34. line-height: 1.6em;
  35. font-family: $fonts;
  36. letter-spacing: .06em;
  37. transition: background-color .5s, color .5s;
  38. }
  39. pre,
  40. code,
  41. pre tt {
  42. font-family: $mono-fonts;
  43. letter-spacing: normal;
  44. }
  45. pre {
  46. padding: .7em 1.1em;
  47. overflow: auto;
  48. font-size: .9em;
  49. line-height: 1.2;
  50. white-space: pre;
  51. border-radius: 4px;
  52. code {
  53. padding: 0;
  54. margin: 0;
  55. background: transparent;
  56. }
  57. }
  58. code {
  59. background: var(--c-bg-alt);
  60. border-radius: 3px;
  61. padding: 0 3px;
  62. margin: 0 4px;
  63. letter-spacing: normal;
  64. }
  65. blockquote {
  66. margin: 1.5em 1em;
  67. font-style: italic;
  68. color: var(--c-txt-alt);
  69. &::before {
  70. content: "“ ";
  71. position: absolute;
  72. opacity: 0.3;
  73. font-size: 80px;
  74. transform: translate(-16px,5px);
  75. }
  76. p {
  77. margin-left: 1.2em;
  78. }
  79. cite {
  80. font-weight: bold;
  81. font-style: normal;
  82. margin-left: 1em;
  83. &::before {
  84. content: "—— ";
  85. }
  86. }
  87. }
  88. a {
  89. color: var(--c-txt);
  90. text-decoration: none;
  91. border-bottom: solid 1px var(--c-bg-alt);
  92. transition-property: color, border-color;
  93. transition-duration: .2s;
  94. &:hover {
  95. color: $accent;
  96. border-bottom-color: $accent;
  97. }
  98. &.icon-link {
  99. border-bottom: none;
  100. }
  101. }
  102. table {
  103. border-collapse: collapse;
  104. border-spacing: 0;
  105. empty-cells: show;
  106. width: 100%;
  107. max-width: 100%;
  108. th,
  109. td {
  110. padding: 1.5%;
  111. border: 1px solid;
  112. }
  113. th {
  114. font-weight: bold;
  115. vertical-align: bottom;
  116. }
  117. }
  118. hr {
  119. color: var(--c-bg-alt);
  120. border-top: none;
  121. border-width: 3px 0 0 0;
  122. border-style: dashed;
  123. }
  124. // Global layouts
  125. //
  126. #page {
  127. display: flex;
  128. flex-direction: column;
  129. min-height: 100vh;
  130. }
  131. #bg-img {
  132. position: fixed;
  133. z-index: -1;
  134. top: 0;
  135. width: 100vw;
  136. height: 100vh;
  137. background-image: var(--bg-img);
  138. background-position: center;
  139. background-size: cover;
  140. opacity: .05;
  141. }
  142. main#site-main {
  143. flex-grow: 1;
  144. margin-top: 1em;
  145. }
  146. .wrapper {
  147. width: 100%;
  148. max-width: 100%;
  149. margin: 0 auto;
  150. padding: 0 1em;
  151. }
  152. #home-btn {
  153. border: none;
  154. position: absolute;
  155. &>img{
  156. width: 1.5em;
  157. height: auto;
  158. border-radius: 50%;
  159. }
  160. }
  161. .title-area {
  162. display: flex;
  163. align-items: baseline;
  164. flex-direction: row-reverse;
  165. margin-bottom: 2em;
  166. .title-area-l {
  167. flex: 1;
  168. }
  169. }
  170. h1#page-title {
  171. margin: 0;
  172. font-size: 2em;
  173. line-height: normal;
  174. }
  175. .feather {
  176. display: inline-block;
  177. vertical-align: -.125em;
  178. width: 1em;
  179. height: 1em;
  180. }
  181. @import "partials/home.scss", "partials/404.scss";
  182. @import "partials/single.scss", "partials/list.scss";
  183. @import "partials/footer.scss", "partials/comments.scss";
  184. @media all and (min-width: 550px) {
  185. html {
  186. font-size: 1.1em;
  187. }
  188. #site-footer {
  189. background: transparent;
  190. &>.footer-inner {
  191. display: flex;
  192. flex-direction: row-reverse;
  193. padding-top: 1em;
  194. border-top: 2px solid var(--c-bg-alt);
  195. }
  196. }
  197. .posts-group {
  198. display: flex;
  199. }
  200. .footer-l {
  201. flex: 1;
  202. }
  203. .site-nav > span {
  204. color: var(--c-bg-alt);
  205. }
  206. .social-icon > .icon-link {
  207. margin-left: .4em;
  208. margin-right: 0;
  209. }
  210. .recent-posts-list a {
  211. display: inline;
  212. }
  213. }
  214. @media all and (min-width: 810px) {
  215. main#site-main {
  216. margin-top: 3em;
  217. }
  218. .wrapper {
  219. max-width: 780px;
  220. text-align: justify;
  221. }
  222. #home-btn>img {
  223. width: 2em;
  224. }
  225. #page.error-404 {
  226. flex-direction: row;
  227. }
  228. .content a.anchor {
  229. float: left;
  230. margin-left: -1em;
  231. }
  232. .posts-group {
  233. display: flex;
  234. }
  235. .content figure.big {
  236. margin-left: calc(390px - var(--vw) * 50 - 1em);
  237. }
  238. }
  239. @media all and (min-width: 1250px) {
  240. main#site-main {
  241. margin-top: 4.5em;
  242. }
  243. .wrapper {
  244. max-width: 980px;
  245. }
  246. .content a.anchor {
  247. float: left;
  248. margin-left: -1em;
  249. }
  250. .posts-group {
  251. display: flex;
  252. }
  253. .content figure.big {
  254. margin-left: calc(490px - var(--vw) * 50 - 1em);
  255. }
  256. }
  257. @media all and (min-width: 1590px) {
  258. :root {
  259. --offset: 280px;
  260. }
  261. html {
  262. font-size: 1.2em;
  263. }
  264. main#site-main {
  265. margin-top: 6em;
  266. }
  267. #home-center, #home-footer {
  268. padding-left: 15vw;
  269. padding-right: 15vw;
  270. }
  271. .wrapper {
  272. margin-left: var(--offset);
  273. }
  274. #toc-btn {
  275. display: none;
  276. }
  277. #toc {
  278. display: block!important;
  279. position: sticky;
  280. float: left;
  281. top: 2em;
  282. width: calc(var(--offset) - 2em);
  283. padding: 0 0 0 1em;
  284. margin-left: calc(0px - var(--offset));
  285. border-right: 2px solid var(--c-bg-alt);
  286. border-radius: 0;
  287. background: transparent;
  288. text-align: right;
  289. .toc-title {
  290. display: block;
  291. padding-right: 1em;
  292. margin-top: 0;
  293. font-weight: bold;
  294. }
  295. }
  296. #TableOfContents {
  297. direction: rtl;
  298. font-size: .8em;
  299. a {
  300. display: inline;
  301. }
  302. }
  303. .content > figure {
  304. text-align: left;
  305. &.big {
  306. width: calc(var(--vw) * 100 - var(--offset) - 1em);
  307. margin-left: 0;
  308. &>img {
  309. margin-left: 0;
  310. }
  311. }
  312. &.right {
  313. margin-right: -280px;
  314. }
  315. }
  316. }
  317. @media all and (min-width: 1800px) {
  318. :root {
  319. --offset: 380px;
  320. }
  321. }