hexo-theme-stellar 1.17.2 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/_config.yml +20 -26
  2. package/_data/widgets.yml +0 -15
  3. package/layout/_partial/sidebar/header.ejs +4 -4
  4. package/layout/_partial/sidebar/index.ejs +4 -4
  5. package/layout/_partial/widgets/search.ejs +1 -0
  6. package/package.json +1 -1
  7. package/scripts/generators/search.js +2 -0
  8. package/scripts/tags/{border.js → ablock.js} +8 -10
  9. package/scripts/tags/{split.js → grid.js} +5 -5
  10. package/scripts/tags/note.js +5 -7
  11. package/scripts/tags/poetry.js +4 -5
  12. package/scripts/tags/quot.js +8 -4
  13. package/scripts/tags/tag.js +35 -0
  14. package/scripts/tags/toc.js +2 -2
  15. package/source/css/_common/highlight.styl +0 -3
  16. package/source/css/_custom.styl +13 -27
  17. package/source/css/_defines/theme.styl +47 -34
  18. package/source/css/_layout/md.styl +6 -4
  19. package/source/css/_layout/partial/paginator.styl +2 -1
  20. package/source/css/_layout/partial/related.styl +1 -1
  21. package/source/css/_layout/sidebar/header.styl +2 -2
  22. package/source/css/_layout/tag-plugins/common.styl +51 -65
  23. package/source/css/_layout/tag-plugins/folding.styl +10 -11
  24. package/source/css/_layout/tag-plugins/{split.styl → grid.styl} +4 -4
  25. package/source/css/_layout/tag-plugins/link.styl +1 -1
  26. package/source/css/_layout/tag-plugins/mark.styl +2 -2
  27. package/source/css/_layout/tag-plugins/navbar.styl +1 -1
  28. package/source/css/_layout/tag-plugins/note.styl +3 -1
  29. package/source/css/_layout/tag-plugins/poetry.styl +26 -25
  30. package/source/css/_layout/tag-plugins/quot.styl +47 -58
  31. package/source/css/_layout/tag-plugins/tag.styl +13 -0
  32. package/source/css/_layout/widgets/ghuser.styl +19 -15
  33. package/source/css/_layout/widgets/search.styl +101 -1
  34. package/source/css/_layout/widgets/toc_common.styl +1 -1
  35. package/source/css/_plugins/comments/twikoo.styl +0 -1
  36. package/source/css/_plugins/index.styl +0 -3
  37. package/source/js/plugins/weibo.js +116 -0
  38. package/source/css/_plugins/search/local-search.styl +0 -87
package/_config.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  ######## Stellar info ########
2
2
  stellar:
3
- version: '1.17.2'
3
+ version: '1.18.0'
4
4
  homepage: 'https://xaoxuu.com/wiki/stellar/'
5
5
  repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
6
6
  cdn_css: # Use cdn links instead of /css/main.css
@@ -27,20 +27,20 @@ sidebar:
27
27
  widgets:
28
28
  #### 自动生成的页面 ####
29
29
  # 主页
30
- home: search, welcome, recent, timeline # for home
30
+ home: search, recent, timeline # for home
31
31
  # 博客索引页
32
32
  blog_index: search_blog, recent, timeline # for categories/tags/archives
33
33
  # 文档索引页
34
34
  wiki_index: search_docs, recent, timeline # for wiki
35
35
  # 其它(404)
36
- others: search, welcome, recent, timeline # for 404 and ...
36
+ others: search, recent, timeline # for 404 and ...
37
37
  #### 手动创建的页面 ####
38
38
  # 文章内页
39
- post: toc, ghrepo, search, ghissues # for pages using 'layout:post'
39
+ post: search_blog, toc, ghrepo, ghissues # for pages using 'layout:post'
40
40
  # 文档内页
41
41
  wiki: search, ghrepo, toc, ghissues, related # for pages using 'layout:wiki'
42
42
  # 其它 layout:page 的页面
43
- page: welcome, toc, search # for custom pages using 'layout:page'
43
+ page: toc, search # for custom pages using 'layout:page'
44
44
 
45
45
  ######## Index ########
46
46
  post-index: # 近期发布 分类 标签 归档 and ...
@@ -243,6 +243,9 @@ tag_plugins:
243
243
  # {% mark %}
244
244
  mark:
245
245
  default_color: dark # light, dark, red, orange, yellow, green, cyan, blue, purple, warning, error
246
+ # {% tag %}
247
+ tag:
248
+ default_color: yellow # red, orange, yellow, green, cyan, blue, purple
246
249
 
247
250
 
248
251
  ######## JS Plugins ########
@@ -259,6 +262,7 @@ plugins:
259
262
  timeline: /js/plugins/timeline.js
260
263
  linkcard: /js/plugins/linkcard.js
261
264
  fcircle: /js/plugins/fcircle.js
265
+ weibo: /js/plugins/weibo.js
262
266
 
263
267
  marked: https://cdn.bootcdn.net/ajax/libs/marked/4.0.18/marked.min.js
264
268
 
@@ -338,27 +342,17 @@ style:
338
342
  code: 'Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif'
339
343
  text-align: left
340
344
  color:
341
- common:
342
- theme: '#1BCDFC' # 主题色
343
- accent: '#ff5722' # 强调色
344
- link: '#2196f3' # 超链接颜色
345
- button: '#1BCDFC' # 按钮颜色
346
- hover: '#ff5722' # 按钮高亮颜色
347
- light:
348
- background: '#F8F9FA' # 浅色背景颜色
349
- block: '#F0F1F2' # 块背景颜色
350
- card: white # 卡片背景颜色
351
- title: '#000' # 标题文本颜色
352
- text: '#333' # 正文文本颜色
353
- code: '#f33a00' # 行内代码颜色
354
- dark:
355
- background: '#313438' # 深色背景颜色
356
- background-mobile: black # 移动端深色背景(OLED调成纯黑可以省电)
357
- block: '#2B2F33' # 块背景颜色
358
- card: '#464D57' # 卡片背景颜色
359
- title: '#fff' # 标题文本颜色
360
- text: '#eee' # 正文文本颜色
361
- code: '#ff7043' # 行内代码颜色
345
+ # 动态颜色(会根据明暗主题重设明度值,只用关心色相和饱和度即可)
346
+ background: 'hsl(212 16% 98%)' # 浅色背景颜色
347
+ block: 'hsl(212 8% 95%)' # 块背景颜色
348
+ code: 'hsl(14 100% 48%)' # 行内代码颜色
349
+ text: 'hsl(0 0% 20%)' # 文本颜色
350
+ # 主题色配置(不会根据明暗动态调整,请设置为通用的颜色)
351
+ theme: 'hsl(192 98% 55%)' # 主题色
352
+ accent: 'hsl(14 100% 57%)' # 强调色
353
+ link: 'hsl(207 90% 54%)' # 超链接颜色
354
+ button: 'hsl(192 98% 55%)' # 按钮颜色
355
+ hover: 'hsl(14 100% 57%)' # 按钮高亮颜色
362
356
  animated_avatar:
363
357
  animate: auto # auto, always
364
358
  background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp
package/_data/widgets.yml CHANGED
@@ -44,7 +44,6 @@ toc:
44
44
  # github user info
45
45
  ghuser:
46
46
  layout: ghuser
47
- api: https://api.github.com
48
47
  username: github # your github login username
49
48
  avatar: true # show avatar or not
50
49
  menu: true # show menu or not
@@ -63,20 +62,6 @@ tagcloud:
63
62
  end_color: # 结束的颜色。您可使用十六进位值(#b700ff),rgba(rgba(183, 0, 255, 1)),hsla(hsla(283, 100%, 50%, 1))或 颜色关键字。此变量仅在 color 参数开启时才有用。
64
63
  show_count: false # 显示每个标签的文章总数
65
64
 
66
- welcome:
67
- layout: markdown
68
- title: Stellar 入门指南
69
- content: | # support markdown
70
- 欢迎使用 [Stellar](https://github.com/xaoxuu/hexo-theme-stellar/) 主题,下面是您的入门指南,祝您使用愉快!
71
- <br>
72
- **第一步**
73
- 创建 `blog/_config.stellar.yml` 文件,在此文件中填写需要自定义的主题配置。
74
- <br>
75
- **第二步**
76
- 创建 `blog/source/_data/widgets.yml` 文件,此文件中填写需要自定义的侧边栏组件,例如 `welcome` 组件。
77
- <br>
78
- 如果有任何疑问,请先查阅 [文档](https://xaoxuu.com/wiki/stellar/),如果文档中没有提供,请提 [issue](https://github.com/xaoxuu/hexo-theme-stellar/issues/) 向开发中询问。
79
-
80
65
  timeline:
81
66
  layout: timeline
82
67
  title: 近期动态
@@ -10,10 +10,10 @@ function layoutTitle(main, url, sub) {
10
10
  if (sub) {
11
11
  let arr = sub.split('|');
12
12
  if (arr.length > 1) {
13
- el += '<div class="sub normal cap">' + arr[0].trim() + '</div>';
14
- el += '<div class="sub hover cap" style="opacity:0">' + arr[1].trim() + '</div>';
15
- } else if (arr.length > 0) {
16
- el += '<div class="sub cap">' + arr[0] + '</div>';
13
+ el += '<div class="sub normal cap">' + arr.shift().trim() + '</div>';
14
+ el += '<div class="sub hover cap" style="opacity:0">' + arr.join('|') + '</div>';
15
+ } else {
16
+ el += '<div class="sub cap">' + sub + '</div>';
17
17
  }
18
18
  }
19
19
  el += '</a>';
@@ -40,10 +40,10 @@ function layoutTitle(main, url, sub) {
40
40
  if (sub) {
41
41
  let arr = sub.split('|');
42
42
  if (arr.length > 1) {
43
- el += '<div class="sub normal cap">' + arr[0].trim() + '</div>';
44
- el += '<div class="sub hover cap" style="opacity:0">' + arr[1].trim() + '</div>';
45
- } else if (arr.length > 0) {
46
- el += '<div class="sub cap">' + arr[0] + '</div>';
43
+ el += '<div class="sub normal cap">' + arr.shift().trim() + '</div>';
44
+ el += '<div class="sub hover cap" style="opacity:0">' + arr.join('|') + '</div>';
45
+ } else {
46
+ el += '<div class="sub cap">' + sub + '</div>';
47
47
  }
48
48
  }
49
49
  el += '</a>';
@@ -27,6 +27,7 @@ function layoutDiv() {
27
27
  } else {
28
28
  el += ' placeholder="' + (item.placeholder || __('search.search')) + '">'
29
29
  }
30
+ el += '<svg t="1670596976048" class="icon search-icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2676" width="200" height="200"><path d="M938.2 832.6L723.8 618.1c-2.5-2.5-5.3-4.4-7.9-6.4 36.2-55.6 57.3-121.8 57.3-193.1C773.3 222.8 614.6 64 418.7 64S64 222.8 64 418.6c0 195.9 158.8 354.6 354.6 354.6 71.3 0 137.5-21.2 193.2-57.4 2 2.7 3.9 5.4 6.3 7.8L832.5 938c14.6 14.6 33.7 21.9 52.8 21.9 19.1 0 38.2-7.3 52.8-21.8 29.2-29.1 29.2-76.4 0.1-105.5M418.7 661.3C284.9 661.3 176 552.4 176 418.6 176 284.9 284.9 176 418.7 176c133.8 0 242.6 108.9 242.6 242.7 0 133.7-108.9 242.6-242.6 242.6" p-id="2677"></path></svg>'
30
31
  el += '</form>'
31
32
  el += '<div id="search-result"></div>'
32
33
  el += '<div class="search-no-result">' + __('search.no_results') + '</div>'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hexo-theme-stellar",
3
- "version": "1.17.2",
3
+ "version": "1.18.0",
4
4
  "description": "Elegant and powerful theme for Hexo.",
5
5
  "main": "package.json",
6
6
  "scripts": {
@@ -54,6 +54,8 @@ hexo.extend.generator.register('search_json_generator', function (locals) {
54
54
  content = content.replace(/[#]{2,} /g, '')
55
55
  // 部分HTML标签
56
56
  content = content.replace(/<iframe[\s|\S]+iframe>/g, '')
57
+ content = content.replace(/<hr>/g, '')
58
+ content = content.replace(/<br>/g, '')
57
59
  // 图片
58
60
  content = content.replace(/\!\[(.*?)\]\((.*?)\)/g, '')
59
61
  // 链接
@@ -1,23 +1,21 @@
1
1
  /**
2
- * border.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
2
+ * ablock.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% border [color:color] [child:codeblock/tabs] title %}
5
+ * {% ablock [color:color] [child:codeblock/tabs] title %}
6
6
  * body
7
- * {% endborder %}
7
+ * {% endablock %}
8
8
  */
9
9
 
10
10
  'use strict';
11
11
 
12
- hexo.extend.tag.register('border', function(args, content) {
12
+ hexo.extend.tag.register('ablock', function(args, content) {
13
13
  args = hexo.args.map(args, ['color', 'child'], ['title']);
14
- const color = args.color;
15
- const title = args.title;
16
- var el = '';
17
- const defaultColor = hexo.theme.config.tag_plugins.note.default_color;
18
- if (!color && defaultColor) {
19
- color = defaultColor;
14
+ const { title } = args;
15
+ if (args.color == null) {
16
+ args.color = hexo.theme.config.tag_plugins.note.default_color
20
17
  }
18
+ var el = '';
21
19
  // header
22
20
  el += '<div class="tag-plugin note"';
23
21
  el += ' ' + hexo.args.joinTags(args, ['color', 'child']).join(' ');
@@ -1,21 +1,21 @@
1
1
  /**
2
- * split.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
2
+ * grid.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% split [style:block/card] %}
5
+ * {% grid [style:block/card] %}
6
6
  * <!-- cell left -->
7
7
  * left body
8
8
  * <!-- cell right -->
9
9
  * right body
10
- * {% endsplit %}
10
+ * {% endgrid %}
11
11
  */
12
12
 
13
13
  'use strict';
14
14
 
15
- hexo.extend.tag.register('split', function(args, content) {
15
+ hexo.extend.tag.register('grid', function(args, content) {
16
16
  args = hexo.args.map(args, ['bg']);
17
17
  var el = '';
18
- el += '<div class="tag-plugin split"';
18
+ el += '<div class="tag-plugin grid"';
19
19
  el += ' ' + hexo.args.joinTags(args, ['bg']).join(' ');
20
20
  el += '>';
21
21
 
@@ -13,20 +13,18 @@ hexo.extend.tag.register('note', function(args) {
13
13
  args.content = args.title;
14
14
  args.title = '';
15
15
  }
16
- const color = args.color;
17
- const title = args.title;
18
- var el = '';
19
- const defaultColor = hexo.theme.config.tag_plugins.note.default_color;
20
- if (!color && defaultColor) {
21
- color = defaultColor;
16
+ const { title } = args;
17
+ if (args.color == null) {
18
+ args.color = hexo.theme.config.tag_plugins.note.default_color
22
19
  }
20
+ var el = '';
23
21
  // header
24
22
  el += '<div class="tag-plugin note"';
25
23
  el += ' ' + hexo.args.joinTags(args, ['color', 'child']).join(' ');
26
24
  el += '>';
27
25
  // title
28
26
  if (title && title.length > 0) {
29
- el += '<div class="title"><strong>' + title + '</strong></div>';
27
+ el += '<div class="title">' + title + '</div>';
30
28
  }
31
29
  // content
32
30
  el += '<div class="body">';
@@ -3,7 +3,7 @@
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
5
  * poetry:
6
- * {% poetry [align:center] [title] [author:作者] [date:日期] [footer:footer] %}
6
+ * {% poetry [title] [author:作者] [date:日期] [footer:footer] %}
7
7
  * body
8
8
  * {% endpoetry %}
9
9
  *
@@ -13,13 +13,11 @@
13
13
 
14
14
  hexo.extend.tag.register('poetry', function(args, content) {
15
15
  var el = '';
16
- args = hexo.args.map(args, ['author', 'date', 'align', 'footer'], ['title']);
16
+ args = hexo.args.map(args, ['author', 'date', 'footer'], ['title']);
17
17
 
18
18
  el += '<div class="tag-plugin poetry"';
19
- if (args.align) {
20
- el += ' align="' + args.align + '"';
21
- }
22
19
  el += '>';
20
+ el += '<div class="content">'
23
21
  if (args.title) {
24
22
  el += '<div class="title">';
25
23
  el += args.title;
@@ -43,6 +41,7 @@ hexo.extend.tag.register('poetry', function(args, content) {
43
41
  el += args.footer;
44
42
  el += '</div>';
45
43
  }
44
+ el += '</div>'
46
45
  el += '</div>';
47
46
  return el;
48
47
  }, {ends: true});
@@ -1,9 +1,9 @@
1
1
  /**
2
- * quot.js v1.1 | https://github.com/xaoxuu/hexo-theme-stellar/
2
+ * quot.js v1.2 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
5
  * quot:
6
- * {% quot [el:h1] [icon:default] text %}
6
+ * {% quot [el:h2] [icon:default] text %}
7
7
  *
8
8
  */
9
9
 
@@ -38,14 +38,18 @@ hexo.extend.tag.register('quot', function(args) {
38
38
  return el;
39
39
  }
40
40
  if (args.el.includes('h')) {
41
- el += '<' + args.el + ' class="tag-plugin quot"' + type + ' id="' + args.text + '">';
41
+ el += '<div' + ' class="tag-plugin quot">'
42
+ el += '<' + args.el + ' class="content" id="' + args.text + '"' + type + '>';
42
43
  el += '<a href="#' + args.text + '" class="headerlink" title="' + args.text + '"></a>';
43
44
  el += content();
44
45
  el += '</' + args.el + '>';
46
+ el += '</div>'
45
47
  } else {
46
- el += '<' + args.el + ' class="tag-plugin quot"' + type + '>';
48
+ el += '<div' + ' class="tag-plugin quot">'
49
+ el += '<' + args.el + ' class="content"' + type + '>';
47
50
  el += content();
48
51
  el += '</' + args.el + '>';
52
+ el += '</div>'
49
53
  }
50
54
  return el;
51
55
  });
@@ -0,0 +1,35 @@
1
+ /**
2
+ * tag.js v1.0 | https://github.com/xaoxuu/hexo-theme-stellar/
3
+ * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
+ *
5
+ * {% tag text href [color:color] %}
6
+ *
7
+ */
8
+
9
+ 'use strict';
10
+
11
+ const tag_colors = ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple']
12
+ var tag_index = 0;
13
+
14
+ hexo.extend.tag.register('tag', function(args) {
15
+ args = hexo.args.map(args, ['color'], ['text', 'href']);
16
+ if (args.color == null) {
17
+ const default_color = hexo.theme.config.tag_plugins.tag?.default_color
18
+ if (default_color) {
19
+ args.color = default_color
20
+ } else {
21
+ args.color = tag_colors[tag_index]
22
+ tag_index += 1
23
+ if (tag_index >= tag_colors.length) {
24
+ tag_index = 0
25
+ }
26
+ }
27
+ }
28
+ var el = '';
29
+ el += '<a class="tag-plugin tag"';
30
+ el += ' ' + hexo.args.joinTags(args, ['color', 'href']).join(' ');
31
+ el += '>';
32
+ el += args.text;
33
+ el += '</a>';
34
+ return el;
35
+ });
@@ -2,7 +2,7 @@
2
2
  * toc.js v1 | https://github.com/xaoxuu/hexo-theme-stellar/
3
3
  * 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
4
4
  *
5
- * {% toc wiki:xxx [open:true] [display:mobile] title %}
5
+ * {% toc wiki:xxx [title] [open:true] [display:mobile] %}
6
6
  */
7
7
 
8
8
  'use strict';
@@ -33,7 +33,7 @@ hexo.extend.tag.register('toc', function(args) {
33
33
  el += '>';
34
34
 
35
35
  el += '<details class="toc"';
36
- if (args.open !== false) {
36
+ if (args.open != 'false') {
37
37
  el += ' open';
38
38
  }
39
39
  el += '>';
@@ -15,7 +15,6 @@ p>code:not([class]),li>code:not([class])
15
15
  border-radius: $border-block
16
16
  overflow: hidden
17
17
  background: var(--block)
18
- border: 1px solid var(--block-border)
19
18
  line-height: 1.5
20
19
  font-family: $ff-code
21
20
  box-sizing: border-box
@@ -35,7 +34,6 @@ p>code:not([class]),li>code:not([class])
35
34
  background: var(--block-hover)
36
35
  border-top-left-radius: "calc(%s - 1px)" % $border-block
37
36
  border-top-right-radius: "calc(%s - 1px)" % $border-block
38
- border-bottom: 1px solid var(--block-border)
39
37
  span
40
38
  margin-right: 4px
41
39
  >table
@@ -102,7 +100,6 @@ table:not([class])
102
100
  >.hljs
103
101
  padding: 1rem
104
102
  border-radius: $border-block
105
- border: 1px solid var(--block-border)
106
103
  line-height: 1.5
107
104
  box-sizing: border-box
108
105
 
@@ -1,31 +1,17 @@
1
1
  @require('_defines/const')
2
2
 
3
3
  // 通用主题色
4
- $color-theme = convert(hexo-config('style.color.common.theme'))
5
- $color-accent = convert(hexo-config('style.color.common.accent'))
6
- $color-link = convert(hexo-config('style.color.common.link'))
7
- $color-button = convert(hexo-config('style.color.common.button'))
8
- $color-hover = convert(hexo-config('style.color.common.hover'))
9
-
10
- // 浅色
11
- $light-background = convert(hexo-config('style.color.light.background'))
12
- $light-block = convert(hexo-config('style.color.light.block'))
13
- $light-card = convert(hexo-config('style.color.light.card'))
14
- $light-title = convert(hexo-config('style.color.light.title'))
15
- $light-text = convert(hexo-config('style.color.light.text'))
16
- $light-code = convert(hexo-config('style.color.light.code'))
17
-
18
- // 深色
19
- $dark-background = convert(hexo-config('style.color.dark.background'))
20
- $dark-block = convert(hexo-config('style.color.dark.block'))
21
- $dark-card = convert(hexo-config('style.color.dark.card'))
22
- $dark-title = convert(hexo-config('style.color.dark.title'))
23
- $dark-text = convert(hexo-config('style.color.dark.text'))
24
- $dark-code = convert(hexo-config('style.color.dark.code'))
25
-
26
- // 移动端深色背景(OLED调成纯黑可以省电)
27
- $dark-background-mobile = convert(hexo-config('style.color.dark.background-mobile'))
28
-
4
+ $color-theme = convert(hexo-config('style.color.theme'))
5
+ $color-accent = convert(hexo-config('style.color.accent'))
6
+ $color-link = convert(hexo-config('style.color.link'))
7
+ $color-button = convert(hexo-config('style.color.button'))
8
+ $color-hover = convert(hexo-config('style.color.hover'))
9
+
10
+ // 动态颜色
11
+ $color-background = convert(hexo-config('style.color.background'))
12
+ $color-block = convert(hexo-config('style.color.block'))
13
+ $color-code = convert(hexo-config('style.color.code'))
14
+ $color-text = convert(hexo-config('style.color.text'))
29
15
 
30
16
  // @font-face
31
17
  // font-family: 'Dosis'
@@ -55,7 +41,7 @@ $fs-13 = .8125rem
55
41
  $fs-12 = .75rem
56
42
 
57
43
  $fs-h1 = 1.75rem // 32px
58
- $fs-h2 = 1.5rem // 24px
44
+ $fs-h2 = 1.5rem // 24px
59
45
  $fs-h3 = 1.375rem // 22px
60
46
  $fs-h4 = 1.125rem // 18px
61
47
  $fs-h5 = $fs-15
@@ -64,7 +50,7 @@ $fs-p = $fs-15
64
50
  $fs-code = $fs-13
65
51
 
66
52
  $border-card = 12px
67
- $border-block = 8px
53
+ $border-block = 6px
68
54
  $border-image = 6px
69
55
 
70
56
  // 可以动态变化的属性
@@ -1,46 +1,59 @@
1
- set_text_light()
2
- --text-p0: $dark-title
3
- --text-p1: mix($dark-text, $dark-background, 85)
4
- --text-p2: mix($dark-text, $dark-background, 70)
5
- --text-p3: mix($dark-text, $dark-background, 45)
6
- --text-p4: mix($dark-text, $dark-background, 35)
7
- --text-meta: mix($dark-text, $dark-background, 30)
8
- --text-code: $dark-code
1
+ $color-background-h = hue($color-background)
2
+ $color-background-s = saturation($color-background)
3
+ $color-background-l = lightness($color-background)
4
+
5
+ $color-block-h = hue($color-block)
6
+ $color-block-s = saturation($color-block)
7
+ $color-block-l = lightness($color-block)
8
+
9
+ $color-code-h = hue($color-code)
10
+ $color-code-s = saturation($color-code)
11
+ $color-code-l = lightness($color-code)
12
+
13
+ $color-text-h = hue($color-text)
14
+ $color-text-s = saturation($color-text)
15
+ $color-text-l = lightness($color-text)
16
+
9
17
  set_text_dark()
10
- --text-p0: $light-title
11
- --text-p1: $light-text
12
- --text-p2: mix($light-text, $light-background, 80)
13
- --text-p3: mix($light-text, $light-background, 60)
14
- --text-p4: mix($light-text, $light-background, 35)
15
- --text-meta: mix($light-text, $light-background, 20)
16
- --text-code: $light-code
18
+ --text-p0: hsl($color-text-h, $color-text-s, 0)
19
+ --text-p1: hsl($color-text-h, $color-text-s, $color-text-l)
20
+ --text-p2: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 0.75)
21
+ --text-p3: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 1.25)
22
+ --text-p4: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 1.5)
23
+ --text-meta: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 2)
24
+ --text-code: hsl($color-code-h, $color-code-s, $color-code-l * 1)
25
+
26
+ set_text_light()
27
+ --text-p0: hsl($color-text-h, $color-text-s, 100)
28
+ --text-p1: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 0.5)
29
+ --text-p2: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 0.75)
30
+ --text-p3: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.2)
31
+ --text-p4: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.4)
32
+ --text-meta: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.75)
33
+ --text-code: hsl($color-code-h, $color-code-s, $color-code-l * 1.25)
34
+
17
35
  :root
18
- --site-bg: $light-background
19
- --card: $light-card
20
- --block: $light-block
21
- --block-border: darken($light-block, 5)
22
- --block-hover: darken($light-block, 2)
36
+ --site-bg: hsl($color-background-h, $color-background-s, 98)
37
+ --card: hsl($color-block-h, $color-block-s, 100)
38
+ --block: hsl($color-block-h, $color-block-s, 95)
39
+ --block-border: hsl($color-block-h, $color-block-s, 90)
40
+ --block-hover: hsl($color-block-h, $color-block-s, 92)
41
+ --block-lighten: hsl($color-block-h, $color-block-s, 100)
23
42
  set_text_dark()
24
- --theme-highlight: darken($color-theme, 5)
25
- --theme-bg: mix($color-theme, $light-card, 10)
43
+ --theme-bg2: $color-theme
26
44
  --theme-link: $color-link
27
45
 
28
46
  set_darkmode()
29
47
  :root
30
- --site-bg: $dark-background
31
- --card: $dark-card
32
- --block: $dark-block
33
- --block-border: lighten($dark-block, 6)
34
- --block-hover: darken($dark-block, 4)
48
+ --site-bg: hsl($color-background-h, $color-background-s / 2, 16)
49
+ --card: hsl($color-block-h, $color-block-s * 1.5, 25)
50
+ --block: hsl($color-block-h, $color-block-s, 12)
51
+ --block-border: hsl($color-block-h, $color-block-s, 24)
52
+ --block-hover: hsl($color-block-h, $color-block-s, 9)
53
+ --block-lighten: hsl($color-block-h, $color-block-s, 30)
35
54
  set_text_light()
36
- --theme-highlight: $color-theme
37
- --theme-bg: mix($color-theme, $dark-card, 10)
38
55
  @media screen and (max-width: $device-mobile-max)
39
- --site-bg: $dark-background-mobile
40
- --card: darken($dark-card, 6)
41
- --block: darken($dark-block, 4)
42
- --block-border: lighten($dark-block, 2)
43
- --block-hover: darken($dark-block,8)
56
+ --site-bg: black
44
57
 
45
58
  if hexo-config('style.darkmode') == 'auto'
46
59
  // 系统的dark模式
@@ -22,8 +22,8 @@ h1.article-title
22
22
  .md-text.content
23
23
  position: relative
24
24
  margin-bottom: 2rem
25
- display: flex
26
- flex-direction: column
25
+ // display: flex
26
+ // flex-direction: column
27
27
  &.indent
28
28
  >p:not([class])
29
29
  text-indent: 'calc(%s * 2)' % $fs-p
@@ -129,7 +129,7 @@ h1.article-title
129
129
  padding: 2px 0
130
130
  text-decoration: none
131
131
  line-height: 1.2
132
- &:after
132
+ &:before
133
133
  content: ''
134
134
  position: absolute
135
135
  border-radius: 2px
@@ -143,9 +143,11 @@ h1.article-title
143
143
  &:hover
144
144
  border-bottom: none
145
145
  color: var(--theme-link)
146
- &:after
146
+ z-index 0
147
+ &:before
147
148
  height: 100%
148
149
  opacity: 0.2
150
+ z-index -1
149
151
  bottom: 0
150
152
  left: -2px
151
153
  right: -2px
@@ -9,10 +9,11 @@
9
9
  border-radius: $border-card
10
10
  overflow: hidden
11
11
  box-shadow: 0 2px 8px 0px rgba(0, 0, 0, 0.03)
12
- .page-number
12
+ .page-number
13
13
  padding: 4px 8px
14
14
  border-radius: 8px
15
15
  background: var(--block)
16
+ margin: 2px
16
17
  .extend
17
18
  text-align: center
18
19
  background-size: contain
@@ -91,7 +91,7 @@
91
91
  text-decoration: underline
92
92
  &:hover
93
93
  color: $color-hover
94
- &:after
94
+ &:before
95
95
  display: none
96
96
  div.cmt-body
97
97
  min-height: 150px
@@ -5,9 +5,9 @@
5
5
  nav.menu
6
6
  margin: 1rem 0
7
7
  background: var(--block)
8
+ border: 1px solid var(--block-border)
8
9
  border-radius: 6px
9
10
  display: flex
10
- padding: 1px
11
11
  flex-wrap: wrap
12
12
  &::-webkit-scrollbar
13
13
  display: none
@@ -28,7 +28,7 @@ nav.menu
28
28
  text-align: center
29
29
  &.active, &:hover
30
30
  color: var(--text-p1)
31
- background: var(--card)
31
+ background: var(--block-lighten)
32
32
  box-shadow: $boxshadow-button
33
33
 
34
34
  .l_left .menu a.nav-item