base.styl 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. //
  2. // Variables
  3. // ==================================================
  4. // Colors
  5. // colors for use across theme.
  6. // --------------------------------------------------
  7. $whitesmoke = #f5f5f5;
  8. $gainsboro = #eee;
  9. $grey-lighter = #ddd;
  10. $grey-light = #ccc;
  11. $grey = #bbb;
  12. $grey-dark = #999;
  13. $grey-dim = #666;
  14. $black-light = #555;
  15. $black-dim = #333;
  16. $black-deep = #222;
  17. $red = #ff2a2a;
  18. $blue-bright = #87daff;
  19. $blue = #0684bd;
  20. $blue-deep = #262a30;
  21. $orange = #fc6423;
  22. // Scaffolding
  23. // Settings for some of the most global styles.
  24. // --------------------------------------------------
  25. // Global text color on <body>
  26. $text-color = $black-light;
  27. $text-color-dark = $grey-light;
  28. // Global link color.
  29. $link-color = $black-light;
  30. $link-color-dark = $grey-light;
  31. $link-hover-color = $black-deep;
  32. $link-hover-color-dark = $gainsboro;
  33. $link-decoration-color = $grey-dark;
  34. $blockquote-color = $grey-dim;
  35. $blockquote-color-dark = $grey;
  36. // Global border color.
  37. $border-color = $grey-light;
  38. // Background color for <body>
  39. $body-bg-color = white;
  40. $body-bg-color-dark = #282828;
  41. $content-bg-color = white;
  42. $content-bg-color-dark = $black-dim;
  43. // Selection
  44. $selection-bg = $blue-deep;
  45. $selection-color = $gainsboro;
  46. // Dark mode color
  47. $card-bg-color = $whitesmoke;
  48. $card-bg-color-dark = $black-light;
  49. $menu-item-bg-color = $whitesmoke;
  50. $menu-item-bg-color-dark = $black-light;
  51. // Typography
  52. // Font, line-height, and elements colors.
  53. // --------------------------------------------------
  54. get_font_family(config) {
  55. $custom-family = hexo-config('font.' + config + '.family');
  56. return $custom-family is a 'string' ? $custom-family : null;
  57. }
  58. // Font families.
  59. $font-family-chinese = "PingFang SC", "Microsoft YaHei";
  60. $font-family-base = $font-family-chinese, sans-serif;
  61. $font-family-base = get_font_family('global'), $font-family-chinese, sans-serif if get_font_family('global');
  62. $font-family-logo = $font-family-base;
  63. $font-family-logo = get_font_family('title'), $font-family-base if get_font_family('title');
  64. $font-family-headings = $font-family-base;
  65. $font-family-headings = get_font_family('headings'), $font-family-base if get_font_family('headings');
  66. $font-family-posts = $font-family-base;
  67. $font-family-posts = get_font_family('posts'), $font-family-base if get_font_family('posts');
  68. $font-family-monospace = consolas, Menlo, monospace, $font-family-chinese;
  69. $font-family-monospace = get_font_family('codes'), consolas, Menlo, monospace, $font-family-chinese if get_font_family('codes');
  70. // Font size
  71. $font-size-base = (hexo-config('font.enable') and hexo-config('font.global.size') is a 'unit') ? unit(hexo-config('font.global.size'), em) : 1em;
  72. $font-size-smallest = .75em;
  73. $font-size-smaller = .8125em;
  74. $font-size-small = .875em;
  75. $font-size-medium = 1em;
  76. $font-size-large = 1.125em;
  77. $font-size-larger = 1.25em;
  78. $font-size-largest = 1.5em;
  79. // Headings font size
  80. $font-size-headings-step = .125em;
  81. $font-size-headings-base = (hexo-config('font.enable') and hexo-config('font.headings.size') is a 'unit') ? unit(hexo-config('font.headings.size'), em) : 1.625em;
  82. // Global line height
  83. $line-height-base = 2;
  84. $line-height-code-block = 1.6; // Can't be less than 1.3;
  85. // Z-index master list
  86. // --------------------------------------------------
  87. $zindex-0 = 1000;
  88. $zindex-1 = 1100;
  89. $zindex-2 = 1200;
  90. $zindex-3 = 1300;
  91. $zindex-4 = 1400;
  92. $zindex-5 = 1500;
  93. // Table
  94. // --------------------------------------------------
  95. $table-border-color = $grey-lighter;
  96. $table-font-size = $font-size-small;
  97. $table-cell-border-bottom-color = $grey-lighter;
  98. $table-row-odd-bg-color = #f9f9f9;
  99. $table-row-odd-bg-color-dark = #282828;
  100. $table-row-hover-bg-color = $whitesmoke;
  101. $table-row-hover-bg-color-dark = #363636;
  102. // Code & Code Blocks
  103. // --------------------------------------------------
  104. $code-font-family = $font-family-monospace;
  105. $code-foreground = $black-light;
  106. $code-background = $gainsboro;
  107. // Buttons
  108. // --------------------------------------------------
  109. $btn-default-radius = 0;
  110. $btn-default-bg = $black-deep;
  111. $btn-default-bg-dark = $black-deep;
  112. $btn-default-color = white;
  113. $btn-default-color-dark = $text-color-dark;
  114. $btn-default-border-color = $black-deep;
  115. $btn-default-border-color-dark = $black-light;
  116. $btn-default-hover-bg = white;
  117. $btn-default-hover-bg-dark = $grey-dim;
  118. $btn-default-hover-color = $black-deep;
  119. $btn-default-hover-color-dark = $text-color-dark;
  120. $btn-default-hover-border-color = $black-deep;
  121. $btn-default-hover-border-color-dark = $grey-dim;
  122. // Pagination
  123. // --------------------------------------------------
  124. $pagination-border = $gainsboro;
  125. $pagination-link-bg = transparent;
  126. $pagination-link-color = $link-color;
  127. $pagination-link-border = $gainsboro;
  128. $pagination-link-hover-bg = transparent;
  129. $pagination-link-hover-color = $link-color;
  130. $pagination-link-hover-border = $black-deep;
  131. $pagination-active-bg = $grey-light;
  132. $pagination-active-color = white;
  133. $pagination-active-border = $grey-light;
  134. // Layout sizes
  135. // --------------------------------------------------
  136. $content-desktop = 700px;
  137. $content-desktop-large = 800px;
  138. $content-desktop-largest = 900px;
  139. $content-desktop-padding = 40px;
  140. $content-tablet-padding = 10px;
  141. $content-mobile-padding = 8px;
  142. // Headband
  143. // --------------------------------------------------
  144. $headband-height = 3px;
  145. $headband-bg = $black-deep;
  146. // Section Header
  147. // Variables for header section elements.
  148. // --------------------------------------------------
  149. $head-bg = transparent;
  150. // Site Meta
  151. $site-meta-text-align = center;
  152. $brand-color = white;
  153. $brand-hover-color = white;
  154. $brand-color-dark = $grey-lighter;
  155. $brand-hover-color-dark = $grey-lighter;
  156. $font-size-title = (hexo-config('font.enable') and hexo-config('font.title.size') is a 'unit') ? unit(hexo-config('font.title.size'), em) : 1.375em;
  157. $font-size-subtitle = $font-size-smaller;
  158. $subtitle-color = $grey-dark;
  159. $site-subtitle-color = $grey-dark;
  160. // Posts Collpase
  161. // --------------------------------------------------
  162. $posts-collapse-margin = 35px;
  163. $posts-collapse-margin-mobile = 0px;
  164. // Sidebar
  165. // Variables for sidebar section elements.
  166. // --------------------------------------------------
  167. $sidebar-padding = hexo-config('sidebar.padding') is a 'unit' ? unit(hexo-config('sidebar.padding'), px) : 18px;
  168. $sidebar-offset = hexo-config('sidebar.offset') is a 'unit' ? unit(hexo-config('sidebar.offset'), px) : 12px;
  169. $sidebar-nav-color = $grey-dim;
  170. $sidebar-nav-hover-color = $whitesmoke;
  171. $sidebar-highlight = $blue-bright;
  172. $site-author-image-width = 96px;
  173. $site-author-image-border-width = 2px;
  174. $site-author-image-border-color = $black-dim;
  175. $site-author-name-margin = 5px 0 0;
  176. $site-author-name-color = $whitesmoke;
  177. $site-author-name-weight = normal;
  178. $site-description-font-size = $font-size-medium;
  179. $site-description-color = $grey-dark;
  180. $site-description-margin-top = 5px;
  181. $site-state-item-count-font-size = $font-size-larger;
  182. $site-state-item-name-font-size = $font-size-small;
  183. $site-state-item-name-color = inherit;
  184. $site-state-item-border-color = $black-dim;
  185. // Components
  186. // --------------------------------------------------
  187. // Back to top
  188. $b2t-opacity = 1;
  189. $b2t-opacity-hover = .8;
  190. $b2t-position-bottom = -100px;
  191. $b2t-position-bottom-on = 19px;
  192. $b2t-position-right = 30px;
  193. $b2t-position-right-mobile = 20px;
  194. $b2t-font-size = 12px;
  195. $b2t-color = white;
  196. $b2t-bg-color = $black-deep;
  197. // .post-expand .post-eof
  198. // In Muse scheme, margin above and below the post separator
  199. $post-eof-margin-top = 80px; // or 160px for more white space;
  200. $post-eof-margin-bottom = 60px; // or 120px for less white space;
  201. // Iconography
  202. // Icons SVG Base64
  203. // --------------------------------------------------
  204. // blockquote-center icon
  205. $center-quote-left = '../images/quote-l.svg';
  206. $center-quote-right = '../images/quote-r.svg';
  207. // Note colors
  208. // --------------------------------------------------
  209. // Read note light_bg_offset from NexT config and set in "$lbg%" to use it as string variable.
  210. $lbg = hexo-config('note.light_bg_offset') is a 'unit' ? unit(hexo-config('note.light_bg_offset'), "%") : 0;
  211. // Default
  212. $note-border-radius = 3px;
  213. $note-default-border = #777;
  214. $note-default-bg = lighten(spin($note-default-border, 0), 94% + $lbg);
  215. $note-default-text = $note-default-border;
  216. $note-default-icon = "\f0a9";
  217. $note-modern-default-border = #e1e1e1;
  218. $note-modern-default-bg = lighten(spin($note-modern-default-border, 10), 60% + ($lbg * 4));
  219. $note-modern-default-text = $grey-dim;
  220. $note-modern-default-hover = darken(spin($note-modern-default-text, -10), 32%);
  221. // Primary
  222. $note-primary-border = #6f42c1;
  223. $note-primary-bg = lighten(spin($note-primary-border, 10), 92% + $lbg);
  224. $note-primary-text = $note-primary-border;
  225. $note-primary-icon = "\f055";
  226. $note-modern-primary-border = #e1c2ff;
  227. $note-modern-primary-bg = lighten(spin($note-modern-primary-border, 10), 40% + ($lbg * 4));
  228. $note-modern-primary-text = #6f42c1;
  229. $note-modern-primary-hover = darken(spin($note-modern-primary-text, -10), 22%);
  230. // Info
  231. $note-info-border = #428bca;
  232. $note-info-bg = lighten(spin($note-info-border, -10), 91% + $lbg);
  233. $note-info-text = $note-info-border;
  234. $note-info-icon = "\f05a";
  235. $note-modern-info-border = #b3e5ef;
  236. $note-modern-info-bg = lighten(spin($note-modern-info-border, 10), 50% + ($lbg * 4));
  237. $note-modern-info-text = #31708f;
  238. $note-modern-info-hover = darken(spin($note-modern-info-text, -10), 32%);
  239. // Success
  240. $note-success-border = #5cb85c;
  241. $note-success-bg = lighten(spin($note-success-border, 10), 90% + $lbg);
  242. $note-success-text = $note-success-border;
  243. $note-success-icon = "\f058";
  244. $note-modern-success-border = #d0e6be;
  245. $note-modern-success-bg = lighten(spin($note-modern-success-border, 10), 40% + ($lbg * 4));
  246. $note-modern-success-text = #3c763d;
  247. $note-modern-success-hover = darken(spin($note-modern-success-text, -10), 27%);
  248. // Warning
  249. $note-warning-border = #f0ad4e;
  250. $note-warning-bg = lighten(spin($note-warning-border, 10), 88% + $lbg);
  251. $note-warning-text = $note-warning-border;
  252. $note-warning-icon = "\f06a";
  253. $note-modern-warning-border = #fae4cd;
  254. $note-modern-warning-bg = lighten(spin($note-modern-warning-border, 10), 43% + ($lbg * 4));
  255. $note-modern-warning-text = #8a6d3b;
  256. $note-modern-warning-hover = darken(spin($note-modern-warning-text, -10), 18%);
  257. // Danger
  258. $note-danger-border = #d9534f;
  259. $note-danger-bg = lighten(spin($note-danger-border, -10), 92% + $lbg);
  260. $note-danger-text = $note-danger-border;
  261. $note-danger-icon = "\f056";
  262. $note-modern-danger-border = #ebcdd2;
  263. $note-modern-danger-bg = lighten(spin($note-modern-danger-border, 10), 35% + ($lbg * 4));
  264. $note-modern-danger-text = #a94442;
  265. $note-modern-danger-hover = darken(spin($note-modern-danger-text, -10), 22%);
  266. // Tabs border radius
  267. // --------------------------------------------------
  268. $tbr = 0;
  269. // Label colors
  270. // --------------------------------------------------
  271. $label-default = lighten(spin($note-default-border, 0), 89% + $lbg);
  272. $label-primary = lighten(spin($note-primary-border, 10), 87% + $lbg);
  273. $label-info = lighten(spin($note-info-border, -10), 86% + $lbg);
  274. $label-success = lighten(spin($note-success-border, 10), 85% + $lbg);
  275. $label-warning = lighten(spin($note-warning-border, 10), 83% + $lbg);
  276. $label-danger = lighten(spin($note-danger-border, -10), 87% + $lbg);