hexo-theme-stellar 1.40.0 → 1.41.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 (106) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/_config.yml +33 -10
  3. package/_data/icons.yml +250 -37
  4. package/languages/en.yml +6 -0
  5. package/languages/zh-CN.yml +6 -0
  6. package/languages/zh-TW.yml +6 -0
  7. package/layout/_partial/comments/artalk/script.ejs +25 -8
  8. package/layout/_partial/comments/beaudar/script.ejs +1 -0
  9. package/layout/_partial/comments/twikoo/script.ejs +1 -0
  10. package/layout/_partial/comments/utterances/script.ejs +1 -0
  11. package/layout/_partial/comments/waline/script.ejs +1 -0
  12. package/layout/_partial/head.ejs +43 -7
  13. package/layout/_partial/main/article/article_tags.ejs +16 -0
  14. package/layout/_partial/main/navbar/article_banner.ejs +11 -1
  15. package/layout/_partial/main/notebook/note_card.ejs +1 -1
  16. package/layout/_partial/main/notebook/paginator.ejs +2 -2
  17. package/layout/_partial/main/pin_slider.ejs +2 -2
  18. package/layout/_partial/main/post_list/paginator.ejs +2 -2
  19. package/layout/_partial/menubtn.ejs +2 -2
  20. package/layout/_partial/scripts/defines.ejs +26 -2
  21. package/layout/_partial/scripts.ejs +30 -7
  22. package/layout/_partial/sidebar/logo.ejs +1 -1
  23. package/layout/_partial/sidebar/menu.ejs +1 -1
  24. package/layout/_partial/sidebar/search.ejs +1 -1
  25. package/layout/_partial/widgets/author.ejs +1 -1
  26. package/layout/_partial/widgets/components/link.ejs +2 -2
  27. package/layout/_partial/widgets/ghuser.ejs +1 -1
  28. package/layout/_partial/widgets/related.ejs +1 -1
  29. package/layout/_partial/widgets/toc.ejs +1 -1
  30. package/layout/_partial/widgets/tree.ejs +1 -1
  31. package/layout/_plugins/fancybox.ejs +4 -2
  32. package/layout/_plugins/mermaid.ejs +2 -1
  33. package/layout/_plugins/search/local_search.ejs +4 -3
  34. package/layout/_plugins/swiper.ejs +1 -0
  35. package/layout/categories.ejs +1 -1
  36. package/layout/page.ejs +3 -0
  37. package/layout/tags.ejs +1 -0
  38. package/package.json +1 -1
  39. package/scripts/events/lib/doc_tree.js +12 -208
  40. package/scripts/events/lib/notebooks.js +8 -148
  41. package/scripts/events/lib/utils.js +10 -1
  42. package/scripts/filters/index.js +1 -0
  43. package/scripts/filters/lib/img_lazyload.js +4 -0
  44. package/scripts/filters/lib/img_onerror.js +4 -0
  45. package/scripts/filters/lib/md_table.js +46 -0
  46. package/scripts/generators/search.js +12 -18
  47. package/scripts/generators/stellar-icons.js +47 -0
  48. package/scripts/helpers/ai_label.js +29 -0
  49. package/scripts/helpers/icon.js +2 -2
  50. package/scripts/helpers/json_ld.js +10 -13
  51. package/scripts/helpers/related_posts.js +0 -7
  52. package/scripts/helpers/seo.js +9 -0
  53. package/scripts/lib/ai_label.js +55 -0
  54. package/scripts/lib/doc_tree.js +267 -0
  55. package/scripts/lib/notebooks.js +181 -0
  56. package/scripts/lib/search_index.js +82 -0
  57. package/scripts/lib/seo.js +79 -0
  58. package/scripts/tags/lib/about.js +2 -2
  59. package/scripts/tags/lib/albums.js +1 -1
  60. package/scripts/tags/lib/banner.js +1 -1
  61. package/scripts/tags/lib/chat.js +49 -49
  62. package/scripts/tags/lib/copy.js +1 -1
  63. package/scripts/tags/lib/friends.js +1 -1
  64. package/scripts/tags/lib/gallery.js +1 -1
  65. package/scripts/tags/lib/hashtag.js +1 -1
  66. package/scripts/tags/lib/image.js +3 -3
  67. package/scripts/tags/lib/posters.js +1 -1
  68. package/scripts/tags/lib/sites.js +2 -2
  69. package/source/css/_common/base.styl +5 -9
  70. package/source/css/_common/device.styl +3 -3
  71. package/source/css/_components/md-table.styl +23 -0
  72. package/source/css/_components/pages/archives.styl +2 -22
  73. package/source/css/_components/pages/article-story.styl +4 -4
  74. package/source/css/_components/partial/article-tags.styl +10 -0
  75. package/source/css/_components/partial/bread-nav.styl +14 -0
  76. package/source/css/_components/partial/navbar.styl +10 -2
  77. package/source/css/_components/sidebar/search.styl +24 -4
  78. package/source/css/_components/tag-plugins/table.styl +16 -11
  79. package/source/css/_components/widgets/components.styl +6 -0
  80. package/source/css/_components/widgets/list.styl +6 -0
  81. package/source/css/_components/widgets/toc.styl +1 -1
  82. package/source/css/_custom.styl +1 -12
  83. package/source/css/_defines/func.styl +28 -3
  84. package/source/css/_plugins/index.styl +0 -18
  85. package/source/css/{_plugins/comments → comments}/artalk.styl +4 -0
  86. package/source/css/{_plugins/comments → comments}/twikoo.styl +4 -0
  87. package/source/css/{_plugins → plugins}/mermaid.styl +3 -0
  88. package/source/css/{_plugins → plugins}/swiper.styl +5 -1
  89. package/source/js/icons.js +60 -0
  90. package/source/js/main.js +114 -0
  91. package/source/js/search/highlight.js +82 -0
  92. package/source/js/search/local-search.js +294 -103
  93. package/source/js/services/timeline.js +1 -1
  94. package/source/js/services/weibo.js +3 -3
  95. package/source/js/services.js +179 -0
  96. package/source/js/tagtree.js +29 -0
  97. package/source/js/theme.js +61 -0
  98. package/{layout/_partial/scripts/utils.ejs → source/js/utils.js} +13 -10
  99. package/layout/_partial/scripts/services.ejs +0 -178
  100. package/layout/_partial/scripts/sidebar.ejs +0 -25
  101. package/layout/_partial/scripts/tagtree.ejs +0 -29
  102. package/layout/_partial/scripts/theme.ejs +0 -67
  103. /package/source/css/{_plugins/comments → comments}/beaudar.styl +0 -0
  104. /package/source/css/{_plugins/comments → comments}/utterances.styl +0 -0
  105. /package/source/css/{_plugins/comments → comments}/waline.styl +0 -0
  106. /package/source/css/{_plugins → plugins}/fancybox.styl +0 -0
@@ -34,14 +34,15 @@ ul,ol
34
34
  // table
35
35
  table:not([class])
36
36
  border-collapse: collapse
37
- overflow: auto
37
+ display: block
38
+ overflow-x: auto
39
+ -webkit-overflow-scrolling: touch
38
40
  margin: 1rem 0
39
41
  max-width: 100%
40
42
  vertical-align: text-top
41
43
  --fsp: $fsp2
42
44
  font-size: var(--fsp)
43
45
  scrollbar(0,0)
44
- display: table
45
46
  th
46
47
  background: var(--block)
47
48
  border-top: 1px solid var(--block-border)
@@ -50,6 +51,8 @@ table:not([class])
50
51
  padding: 4px 1em
51
52
  line-height: 1.5
52
53
  tr
54
+ word-break: keep-all
55
+ white-space: nowrap
53
56
  border-bottom: 1px dashed var(--block-border)
54
57
  trans()
55
58
  &:hover
@@ -57,10 +60,3 @@ table:not([class])
57
60
 
58
61
  @media screen and (min-width: $device-mobile-max)
59
62
  width 100%
60
-
61
- @media screen and (max-width: $device-mobile-max)
62
- display: block
63
- tr
64
- word-break: keep-all
65
- white-space:nowrap
66
-
@@ -12,7 +12,7 @@
12
12
  grid-column-end: span 3
13
13
  --inset: 2rem
14
14
  right: 0
15
- bottom: calc(var(--inset) * 2)
15
+ bottom: calc(var(--inset) * 1)
16
16
  margin-left: auto
17
17
  margin-right: var(--inset)
18
18
  float: right
@@ -40,8 +40,8 @@
40
40
  box-sizing: border-box
41
41
  flex: 0 0 auto
42
42
  margin: 0 auto
43
- width: 36px
44
- height: 36px
43
+ width: 40px
44
+ height: 40px
45
45
  padding: 4px
46
46
  line-height: 0
47
47
  font-size: 28px
@@ -0,0 +1,23 @@
1
+ // 普通 Markdown 表格滚动容器:宽度足够时铺满容器,内容超出时横向滚动
2
+ .md-table-scroll
3
+ overflow-x: auto
4
+ -webkit-overflow-scrolling: touch
5
+ max-width: 100%
6
+ margin: 1rem 0
7
+ scrollbar(0,0)
8
+ > table:not([class])
9
+ display: table
10
+ width: 100%
11
+ max-width: none
12
+ margin: 0
13
+ border-collapse: separate
14
+ border-spacing: 0
15
+ border: 1px solid var(--block-border)
16
+ border-radius: $border-card
17
+ overflow: hidden
18
+ th
19
+ border-top: none
20
+ th, td
21
+ border-left: 1px solid var(--block-border)
22
+ &:first-child
23
+ border-left: none
@@ -81,29 +81,9 @@
81
81
  display: flex
82
82
  flex-wrap: wrap
83
83
  padding: 0
84
- margin: 0 -4px
84
+ margin: 0 -0.5rem
85
85
  a.tag
86
- display: inline-flex
87
- align-items: center
88
- position: relative
89
- color: var(--text-p2)
90
- margin: 4px
91
- padding: .5em .75rem
92
- border-radius: 4px
93
- background: var(--block)
94
- font-size: $fs-13
95
- font-weight: 500
96
- &:before
97
- content: "#"
98
- margin-left: -2px
99
- margin-right: 2px
100
- opacity: .4
101
- &:hover
102
- &:before
103
- color var(--theme)
104
- opacity: 1
105
- color: var(--text)
106
- background: var(--block-border)
86
+ tag-chip()
107
87
 
108
88
  @media screen and (min-width: $device-mobile)
109
89
  .post-list.author #archive
@@ -51,9 +51,9 @@
51
51
  vertical-align: middle
52
52
  &:before
53
53
  margin-left: -1em
54
- svg-mask-icon($iH3Left)
54
+ svg-mask-icon(var(--icon-h3-left))
55
55
  &:after
56
- svg-mask-icon($iH3Right)
56
+ svg-mask-icon(var(--icon-h3-right))
57
57
 
58
58
  h4:not([class])
59
59
  position: relative
@@ -115,10 +115,10 @@
115
115
  trans1 all
116
116
  &:before
117
117
  left: -0.3em
118
- svg-mask-icon($iQuoteLeft)
118
+ svg-mask-icon(var(--icon-quote-left))
119
119
  &:after
120
120
  right: -0.3em
121
- svg-mask-icon($iQuoteRight)
121
+ svg-mask-icon(var(--icon-quote-right))
122
122
  p:not([class])
123
123
  color: var(--text-p2)
124
124
  font-size: $fs-body
@@ -0,0 +1,10 @@
1
+ // 文章页标签行(layout: post,渲染于 article-footer 之前)
2
+ .article-tags
3
+ display: flex
4
+ flex-wrap: wrap
5
+ justify-content: center
6
+ align-items: center
7
+ margin: 2rem -0.5rem 0
8
+ line-height: 1.6
9
+ a.tag
10
+ tag-chip()
@@ -16,6 +16,8 @@
16
16
  margin-left: auto
17
17
  white-space: nowrap
18
18
  opacity: .8
19
+ .ai-label.right
20
+ margin-left: auto
19
21
  a
20
22
  color: var(--text-banner)
21
23
  padding: 4px
@@ -39,6 +41,18 @@
39
41
  div#post-meta span.updated
40
42
  visibility: visible
41
43
 
44
+ // 文章 AI 成分标签:彩色文字、无背景,颜色由内联 style 提供(banner 含图片时继承默认色)
45
+ .ai-label
46
+ display: inline-flex
47
+ align-items: center
48
+ gap: 4px
49
+ padding: 4px
50
+ white-space: nowrap
51
+ svg
52
+ height: 1em
53
+ width: auto
54
+ transform: scale(1.25)
55
+
42
56
  .bread-nav .ghrepo
43
57
  font-size: $fs-13
44
58
  display: flex
@@ -7,11 +7,19 @@
7
7
  .navbar-blur
8
8
  margin: 0 1rem
9
9
  position: relative
10
- bar-glass()
10
+ border-radius: $border-bar-container
11
+ corner-shape: $corner-shape
12
+ trans1: all
13
+ // 未吸顶:卡片样式(var(--card) 底色 + 文章卡片同款阴影),与文章卡片一致
14
+ background: var(--card)
15
+ box-shadow: $boxshadow-card
16
+ // 吸顶后恢复玻璃效果(bar-glass()),与之前行为一致
17
+ &.pinned
18
+ bar-glass()
19
+ background: transparent
11
20
 
12
21
  .navbar-container
13
22
  max-width: 100%
14
- margin: 1px
15
23
  border-radius: $border-bar-container
16
24
  overflow: scroll visible
17
25
  scrollbar(0, 0)
@@ -124,18 +124,38 @@
124
124
  border-radius: $border-card-s
125
125
  trans1 background
126
126
  &:hover
127
- background: var(--bg-a100)
127
+ background: var(--bg-a50)
128
128
  li+li
129
129
  margin-top: 8px
130
130
  .search-result-title
131
+ display: block
132
+ overflow: hidden
133
+ color: var(--text-p1)
134
+ font-size: $fs-14
135
+ padding: 0.5rem 1rem
136
+ white-space: nowrap
137
+ text-overflow: ellipsis
138
+
139
+ .search-result-section
140
+ display: block
141
+ overflow: hidden
131
142
  color: var(--text-p1)
132
143
  font-weight: 700
133
144
  font-size: $fs-15
145
+ text-overflow: ellipsis
146
+ white-space: nowrap
147
+ border-bottom: 1px solid var(--block-border)
148
+ padding-bottom: .5rem
149
+ margin-bottom: .5rem
150
+ &:before
151
+ content: '>'
152
+ margin-right: .5em
153
+ color: var(--theme)
134
154
 
135
155
  .search-result-content
136
156
  overflow: hidden
137
157
  color: var(--text-p3)
138
- margin: 4px 0 0
158
+ margin: 0
139
159
  max-height: 13em
140
160
  text-align: justify
141
161
  font-size: $fs-13
@@ -145,8 +165,8 @@
145
165
  -webkit-line-clamp: 2
146
166
 
147
167
  .search-keyword
148
- color: $c-red
149
- border-bottom: 1px dashed $c-red
168
+ color: $c-yellow
169
+ border-bottom: 1px dashed $c-yellow
150
170
  font-weight: bold
151
171
  filter grayscale(25%)
152
172
 
@@ -1,8 +1,19 @@
1
1
  // 表格标签(#466):{% table style:scroll|wrap|compact %}
2
2
  .tag-plugin.table
3
3
  table
4
- border-collapse: collapse
4
+ display: table
5
+ border-collapse: separate
6
+ border-spacing: 0
5
7
  width: 100%
8
+ border: 1px solid var(--block-border)
9
+ border-radius: $border-card
10
+ overflow: hidden
11
+ th
12
+ border-top: none
13
+ th, td
14
+ border-left: 1px solid var(--block-border)
15
+ &:first-child
16
+ border-left: none
6
17
  &.table-scroll
7
18
  overflow-x: auto
8
19
  -webkit-overflow-scrolling: touch
@@ -14,24 +25,18 @@
14
25
  &.table-wrap
15
26
  table
16
27
  table-layout: fixed
17
- border-collapse: separate
18
- border-spacing: 0
19
- border: 1px solid var(--block-border)
20
- border-radius: $border-card
21
- overflow: hidden
22
28
  tr
23
29
  white-space: normal
24
- th
25
- border-top: none
26
30
  th, td
27
31
  word-break: break-word
28
32
  overflow-wrap: anywhere
29
33
  padding: 8px 1em
30
- border-left: 1px solid var(--block-border)
31
- &:first-child
32
- border-left: none
33
34
  &.table-compact
35
+ overflow-x: auto
36
+ -webkit-overflow-scrolling: touch
37
+ scrollbar()
34
38
  table
39
+ min-width: max-content
35
40
  th, td
36
41
  padding: 4px 1em
37
42
  line-height: 1.4
@@ -48,6 +48,12 @@
48
48
  filter: grayscale(100%) brightness(0.8) opacity(0.8)
49
49
  trans1 filter
50
50
  flex-shrink: 0
51
+ .linklist .link .active-dot
52
+ flex-shrink: 0
53
+ width: 8px
54
+ height: 8px
55
+ border-radius: 50%
56
+ background: x-theme-gradient()
51
57
 
52
58
  .widget-body .linklist.left
53
59
  grid-gap: 2px
@@ -25,6 +25,12 @@
25
25
  &.active-icon
26
26
  width: 1rem
27
27
  height: 1rem
28
+ .active-dot
29
+ flex-shrink: 0
30
+ width: 8px
31
+ height: 8px
32
+ border-radius: 50%
33
+ background: x-theme-gradient()
28
34
 
29
35
  .l_left .widget-wrapper.post-list .widget-body a
30
36
  &:hover, &.active
@@ -142,7 +142,7 @@
142
142
  grid-template-rows: 0fr
143
143
 
144
144
  // 操作按钮(回到顶部 / 参与讨论)
145
- .widget-wrapper.toc .widget-body+.widget-footer:before
145
+ .widget-wrapper.toc .widget-footer:before
146
146
  content: ''
147
147
  position absolute
148
148
  background: var(--block-border)
@@ -42,22 +42,11 @@ $c-link = convert(hexo-config('style.color.link'))
42
42
 
43
43
  $c-base-hue = 210deg // 背景/文本颜色的主基调(一般看不出来不需要修改)
44
44
 
45
- // icons
46
-
47
- $iQuoteLeft = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' d='M3.691 6.292C5.094 4.771 7.217 4 10 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 6.925 10H10a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2H3a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789M20 20h-6a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789C16.094 4.771 18.217 4 21 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 17.925 10H21a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2'/%3E%3C/svg%3E"
48
- $iQuoteRight = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' d='M20.309 17.708C22.196 15.66 22.006 13.03 22 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292m-11.007 0C11.19 15.66 10.999 13.03 10.993 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292'/%3E%3C/svg%3E"
49
-
50
- $iH3Left = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M13.488 4.43a.75.75 0 0 1 .081 1.058L7.988 12l5.581 6.512a.75.75 0 1 1-1.138.976l-6-7a.75.75 0 0 1 0-.976l6-7a.75.75 0 0 1 1.057-.081' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M17.75 5a.75.75 0 0 0-1.32-.488l-6 7a.75.75 0 0 0 0 .976l6 7A.75.75 0 0 0 17.75 19z'/%3E%3C/svg%3E"
51
- $iH3Right = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1em' height='1em' viewBox='0 0 24 24'%3E%3C!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --%3E%3Cpath fill='currentColor' fill-rule='evenodd' d='M10.512 4.43a.75.75 0 0 0-.081 1.058L16.012 12l-5.581 6.512a.75.75 0 1 0 1.138.976l6-7a.75.75 0 0 0 0-.976l-6-7a.75.75 0 0 0-1.057-.081' clip-rule='evenodd'/%3E%3Cpath fill='currentColor' d='M6.25 5a.75.75 0 0 1 1.32-.488l6 7a.75.75 0 0 1 0 .976l-6 7A.75.75 0 0 1 6.25 19z'/%3E%3C/svg%3E"
52
-
53
- $iLoadingIcon = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%231cd0fd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath stroke-dasharray='16' stroke-dashoffset='16' d='M12 3c4.97 0 9 4.03 9 9'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='0.6s' values='16;0'/%3E%3CanimateTransform attributeName='transform' dur='3s' repeatCount='indefinite' type='rotate' values='0 12 12;360 12 12'/%3E%3C/path%3E%3Cpath stroke-dasharray='64' stroke-dashoffset='64' stroke-opacity='0.3' d='M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z'%3E%3Canimate fill='freeze' attributeName='stroke-dashoffset' dur='2.4s' values='64;0'/%3E%3C/path%3E%3C/g%3E%3C/svg%3E"
54
-
55
-
56
45
  $border-card-l = convert(hexo-config('style.border-radius.card-l'))
57
46
  $border-card = convert(hexo-config('style.border-radius.card'))
58
47
  $border-card-s = convert(hexo-config('style.border-radius.card-s'))
59
48
  $border-bar = convert(hexo-config('style.border-radius.bar'))
60
- $bar-item-gap = 2px // bar 容器内按钮/标签之间的间距与距边距离(gap + padding 共用)
49
+ $bar-item-gap = 4px // bar 容器内按钮/标签之间的间距与距边距离(gap + padding 共用)
61
50
  $border-bar-container = 'calc(%s + %s)' % ($border-bar $bar-item-gap) // bar 容器圆角 = 按钮圆角($border-bar)+ 间距,保持同心
62
51
  $border-image-l = convert(hexo-config('style.border-radius.image-l'))
63
52
  $border-image = convert(hexo-config('style.border-radius.image'))
@@ -1,9 +1,9 @@
1
- svg-mask-icon($svg)
2
- -webkit-mask-image: url($svg)
1
+ svg-mask-icon($img)
2
+ -webkit-mask-image: $img
3
3
  -webkit-mask-repeat: no-repeat
4
4
  -webkit-mask-position: center
5
5
  -webkit-mask-size: contain
6
- mask-image: url($svg)
6
+ mask-image: $img
7
7
  mask-repeat: no-repeat
8
8
  mask-position: center
9
9
  mask-size: contain
@@ -109,6 +109,31 @@ hover-block($v, $h, $br = 4px)
109
109
  &:hover
110
110
  background: var(--block-border)
111
111
 
112
+ // 标签胶囊(标签页 /blog/tags/ 与文章底部标签复用;间距由容器负边距抵消)
113
+ tag-chip()
114
+ display: inline-flex
115
+ align-items: center
116
+ position: relative
117
+ color: var(--text-p2)
118
+ margin: .5rem
119
+ padding: .5em .75rem
120
+ border-radius: 999px
121
+ background: var(--block)
122
+ font-size: $fs-13
123
+ font-weight: 500
124
+ trans1 all
125
+ svg
126
+ width: 1em
127
+ height: 1em
128
+ margin-right: .25em
129
+ opacity: .4
130
+ &:hover
131
+ color: var(--text)
132
+ background: var(--block-border)
133
+ svg
134
+ color: var(--theme)
135
+ opacity: 1
136
+
112
137
  floatable-trans()
113
138
  trans2 transform box-shadow
114
139
  floatable-float()
@@ -2,29 +2,11 @@
2
2
  @import 'aplayer'
3
3
 
4
4
  // 根据主题配置加载
5
- if hexo-config('plugins.swiper.enable')
6
- @import 'swiper'
7
5
  if hexo-config('plugins.scrollreveal.enable')
8
6
  @import 'scrollreveal'
9
- if hexo-config('plugins.fancybox.enable')
10
- @import 'fancybox'
11
- if hexo-config('plugins.mermaid.style_optimization')
12
- @import 'mermaid'
13
7
  if hexo-config('plugins.copycode.enable')
14
8
  @import 'copycode'
15
9
  if hexo-config('plugins.tianli_gpt.enable')
16
10
  @import 'tianli_gpt'
17
11
  if hexo-config('plugins.katex.enable')
18
12
  @import 'katex'
19
-
20
- // 评论
21
- if hexo-config('comments.service') == 'beaudar' or index(hexo-config('comments.custom_css'), 'beaudar') >= 0
22
- @import 'comments/beaudar'
23
- if hexo-config('comments.service') == 'twikoo' or index(hexo-config('comments.custom_css'), 'twikoo') >= 0
24
- @import 'comments/twikoo'
25
- if hexo-config('comments.service') == 'utterances' or index(hexo-config('comments.custom_css'), 'utterances') >= 0
26
- @import 'comments/utterances'
27
- if hexo-config('comments.service') == 'waline' or index(hexo-config('comments.custom_css'), 'waline') >= 0
28
- @import 'comments/waline'
29
- if hexo-config('comments.service') == 'artalk' or index(hexo-config('comments.custom_css'), 'artalk') >= 0
30
- @import 'comments/artalk'
@@ -1,3 +1,7 @@
1
+ @import '../_defines/const'
2
+ @import '../_custom'
3
+ @import '../_defines/func'
4
+
1
5
  .cmt-body.artalk .artalk
2
6
  margin-top: 1rem
3
7
  .atk-editor-plug-preview
@@ -1,3 +1,7 @@
1
+ @import '../_defines/const'
2
+ @import '../_custom'
3
+ @import '../_defines/func'
4
+
1
5
  .cmt-body.twikoo
2
6
  --twikoo-theme: var(--theme)
3
7
  margin-top: 1.5rem
@@ -1,3 +1,6 @@
1
+ @import '../_defines/const'
2
+ @import '../_custom'
3
+
1
4
  pre.mermaid
2
5
  display: flex;
3
6
  align-items: center;
@@ -1,3 +1,7 @@
1
+ @import '../_defines/const'
2
+ @import '../_custom'
3
+ @import '../_defines/func'
4
+
1
5
  :root
2
6
  --swiper-theme-color: var(--theme) !important
3
7
  .swiper
@@ -53,4 +57,4 @@ div.swiper-slide
53
57
  transform: translateX(-1px)
54
58
 
55
59
  .swiper-button-next:after
56
- transform: translateX(1px)
60
+ transform: translateX(1px)
@@ -0,0 +1,60 @@
1
+ /**
2
+ * icons.js | 非首屏图标异步加载
3
+ *
4
+ * 服务端 icon() 对非首屏 SVG 图标输出 <svg class="icon" data-icon="ns:key"> 占位符,
5
+ * 本脚本按命名空间拉取构建期生成的 js/icons/{ns}.json,成功后原位替换为完整内联 SVG,
6
+ * 最终 DOM 与全量内联一致,现有 CSS 钩子(搜索三态、菜单渐变、chat 着色等)不受影响。
7
+ * 首屏关键图标(搜索、菜单、leftbar/rightbar、goback)由模板内联,不经过本脚本。
8
+ */
9
+ (function () {
10
+ 'use strict';
11
+
12
+ const nodes = Array.prototype.slice.call(document.querySelectorAll('svg.icon[data-icon]'));
13
+ if (nodes.length === 0) {
14
+ return;
15
+ }
16
+
17
+ const groups = {};
18
+ nodes.forEach((node) => {
19
+ const key = node.getAttribute('data-icon');
20
+ const idx = key.indexOf(':');
21
+ if (idx < 1) {
22
+ return;
23
+ }
24
+ const ns = key.slice(0, idx);
25
+ if (!groups[ns]) {
26
+ groups[ns] = [];
27
+ }
28
+ groups[ns].push(node);
29
+ });
30
+
31
+ const script = document.currentScript;
32
+ const version = (script && script.getAttribute('data-version')) || '';
33
+ const root = (typeof ctx !== 'undefined' && ctx.root) || '/';
34
+
35
+ Object.keys(groups).forEach((ns) => {
36
+ const url = root + 'js/icons/' + ns + '.json' + (version ? '?v=' + version : '');
37
+ fetch(url)
38
+ .then((res) => {
39
+ if (!res.ok) {
40
+ throw new Error('HTTP ' + res.status);
41
+ }
42
+ return res.json();
43
+ })
44
+ .then((data) => {
45
+ const set = data && data[ns];
46
+ groups[ns].forEach((node) => {
47
+ const key = node.getAttribute('data-icon');
48
+ const svg = set && set[key];
49
+ if (typeof svg === 'string' && svg.length > 0) {
50
+ node.outerHTML = svg;
51
+ } else {
52
+ console.warn('[stellar] icon not found: ' + key);
53
+ }
54
+ });
55
+ })
56
+ .catch((err) => {
57
+ console.warn('[stellar] icons load failed: ' + ns, err);
58
+ });
59
+ });
60
+ })();