hexo-theme-stellar 1.40.0 → 1.42.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 (146) hide show
  1. package/.claude/skills/stellar-theme-dev/SKILL.md +1 -2
  2. package/CHANGELOG.md +90 -0
  3. package/CONTRIBUTING.md +2 -1
  4. package/README.md +50 -21
  5. package/README_EN.md +113 -0
  6. package/_config.yml +40 -12
  7. package/_data/icons.yml +248 -37
  8. package/languages/en.yml +6 -0
  9. package/languages/zh-CN.yml +6 -0
  10. package/languages/zh-TW.yml +6 -0
  11. package/layout/_partial/comments/artalk/script.ejs +25 -8
  12. package/layout/_partial/comments/beaudar/script.ejs +1 -0
  13. package/layout/_partial/comments/twikoo/script.ejs +1 -0
  14. package/layout/_partial/comments/utterances/script.ejs +1 -0
  15. package/layout/_partial/comments/waline/script.ejs +1 -0
  16. package/layout/_partial/cover/index.ejs +0 -3
  17. package/layout/_partial/head.ejs +43 -7
  18. package/layout/_partial/main/article/article_tags.ejs +16 -0
  19. package/layout/_partial/main/navbar/article_banner.ejs +33 -20
  20. package/layout/_partial/main/notebook/note_card.ejs +1 -1
  21. package/layout/_partial/main/notebook/paginator.ejs +2 -2
  22. package/layout/_partial/main/pin_slider.ejs +61 -30
  23. package/layout/_partial/main/post_list/latest_post_card.ejs +25 -0
  24. package/layout/_partial/main/post_list/paginator.ejs +2 -2
  25. package/layout/_partial/main/post_list/post_card.ejs +16 -64
  26. package/layout/_partial/main/post_list/topic_card.ejs +26 -5
  27. package/layout/_partial/menubtn.ejs +2 -2
  28. package/layout/_partial/scripts/bootstrap.ejs +35 -0
  29. package/layout/_partial/scripts/defines.ejs +27 -2
  30. package/layout/_partial/scripts.ejs +39 -7
  31. package/layout/_partial/sidebar/logo.ejs +1 -1
  32. package/layout/_partial/sidebar/menu.ejs +1 -1
  33. package/layout/_partial/sidebar/search.ejs +1 -1
  34. package/layout/_partial/widgets/author.ejs +1 -1
  35. package/layout/_partial/widgets/components/link.ejs +2 -2
  36. package/layout/_partial/widgets/ghuser.ejs +1 -1
  37. package/layout/_partial/widgets/related.ejs +1 -1
  38. package/layout/_partial/widgets/toc.ejs +3 -3
  39. package/layout/_partial/widgets/tree.ejs +1 -1
  40. package/layout/_plugins/adaptive_text.ejs +11 -0
  41. package/layout/_plugins/copycode.ejs +2 -2
  42. package/layout/_plugins/fancybox.ejs +4 -2
  43. package/layout/_plugins/mermaid.ejs +3 -2
  44. package/layout/_plugins/scrollreveal.ejs +22 -16
  45. package/layout/_plugins/search/local_search.ejs +4 -3
  46. package/layout/_plugins/swiper.ejs +2 -1
  47. package/layout/categories.ejs +1 -1
  48. package/layout/index.ejs +10 -2
  49. package/layout/index_topic.ejs +4 -4
  50. package/layout/page.ejs +3 -0
  51. package/layout/tags.ejs +1 -0
  52. package/package.json +3 -3
  53. package/scripts/events/lib/doc_tree.js +12 -208
  54. package/scripts/events/lib/notebooks.js +8 -148
  55. package/scripts/events/lib/utils.js +10 -1
  56. package/scripts/filters/index.js +1 -0
  57. package/scripts/filters/lib/img_lazyload.js +4 -0
  58. package/scripts/filters/lib/img_onerror.js +4 -0
  59. package/scripts/filters/lib/md_table.js +46 -0
  60. package/scripts/generators/search.js +12 -18
  61. package/scripts/generators/stellar-icons.js +47 -0
  62. package/scripts/helpers/ai_label.js +29 -0
  63. package/scripts/helpers/icon.js +2 -2
  64. package/scripts/helpers/json_ld.js +10 -13
  65. package/scripts/helpers/related_posts.js +0 -7
  66. package/scripts/helpers/seo.js +9 -0
  67. package/scripts/helpers/subtitle.js +8 -0
  68. package/scripts/lib/ai_label.js +55 -0
  69. package/scripts/lib/doc_tree.js +267 -0
  70. package/scripts/lib/notebooks.js +181 -0
  71. package/scripts/lib/search_index.js +82 -0
  72. package/scripts/lib/seo.js +79 -0
  73. package/scripts/lib/subtitle.js +24 -0
  74. package/scripts/tags/lib/about.js +2 -2
  75. package/scripts/tags/lib/albums.js +1 -1
  76. package/scripts/tags/lib/banner.js +5 -4
  77. package/scripts/tags/lib/chat.js +49 -49
  78. package/scripts/tags/lib/copy.js +1 -1
  79. package/scripts/tags/lib/friends.js +1 -1
  80. package/scripts/tags/lib/gallery.js +1 -1
  81. package/scripts/tags/lib/hashtag.js +1 -1
  82. package/scripts/tags/lib/image.js +3 -3
  83. package/scripts/tags/lib/posters.js +1 -1
  84. package/scripts/tags/lib/sites.js +2 -2
  85. package/source/css/_common/base.styl +5 -9
  86. package/source/css/_common/cover-overlay.styl +111 -0
  87. package/source/css/_common/device.styl +3 -3
  88. package/source/css/_common/title.styl +17 -0
  89. package/source/css/_components/layout.styl +9 -13
  90. package/source/css/_components/list.styl +135 -64
  91. package/source/css/_components/main.styl +2 -2
  92. package/source/css/_components/md-table.styl +23 -0
  93. package/source/css/_components/pages/archives.styl +5 -22
  94. package/source/css/_components/pages/article-story.styl +5 -14
  95. package/source/css/_components/partial/article-banner.styl +61 -37
  96. package/source/css/_components/partial/article-tags.styl +13 -0
  97. package/source/css/_components/partial/bread-nav.styl +19 -12
  98. package/source/css/_components/partial/navbar.styl +11 -3
  99. package/source/css/_components/partial/post-panel.styl +76 -0
  100. package/source/css/_components/pin-slider.styl +38 -41
  101. package/source/css/_components/sidebar/footer.styl +1 -1
  102. package/source/css/_components/sidebar/logo.styl +2 -2
  103. package/source/css/_components/sidebar/search.styl +25 -5
  104. package/source/css/_components/sidebar/sidebar.styl +7 -7
  105. package/source/css/_components/tag-plugins/banner.styl +53 -11
  106. package/source/css/_components/tag-plugins/friends_posts.styl +5 -86
  107. package/source/css/_components/tag-plugins/gallery.styl +3 -0
  108. package/source/css/_components/tag-plugins/read/paper.styl +3 -3
  109. package/source/css/_components/tag-plugins/read/reel.styl +4 -4
  110. package/source/css/_components/tag-plugins/table.styl +16 -11
  111. package/source/css/_components/tag-plugins/timeline.styl +4 -0
  112. package/source/css/_components/widgets/components.styl +6 -0
  113. package/source/css/_components/widgets/list.styl +6 -0
  114. package/source/css/_components/widgets/timeline.styl +2 -2
  115. package/source/css/_components/widgets/toc.styl +13 -7
  116. package/source/css/_components/widgets/widgets.styl +8 -7
  117. package/source/css/_custom.styl +9 -21
  118. package/source/css/_defines/func.styl +28 -3
  119. package/source/css/_plugins/index.styl +0 -18
  120. package/source/css/_plugins/lazyload.styl +1 -0
  121. package/source/css/{_plugins/comments → comments}/artalk.styl +4 -0
  122. package/source/css/{_plugins/comments → comments}/twikoo.styl +4 -0
  123. package/source/css/{_plugins → plugins}/mermaid.styl +3 -0
  124. package/source/css/{_plugins → plugins}/swiper.styl +5 -1
  125. package/source/js/color.js +325 -0
  126. package/source/js/icons.js +60 -0
  127. package/source/js/main.js +115 -1
  128. package/source/js/plugins/adaptive-text.js +146 -0
  129. package/source/js/search/highlight.js +82 -0
  130. package/source/js/search/local-search.js +294 -103
  131. package/source/js/services/friends_and_posts.js +1 -1
  132. package/source/js/services/timeline.js +1 -1
  133. package/source/js/services/weibo.js +3 -3
  134. package/source/js/services.js +179 -0
  135. package/source/js/tagtree.js +29 -0
  136. package/source/js/theme.js +61 -0
  137. package/{layout/_partial/scripts/utils.ejs → source/js/utils.js} +27 -11
  138. package/layout/_partial/cover/post_cover.ejs +0 -37
  139. package/layout/_partial/scripts/services.ejs +0 -178
  140. package/layout/_partial/scripts/sidebar.ejs +0 -25
  141. package/layout/_partial/scripts/tagtree.ejs +0 -29
  142. package/layout/_partial/scripts/theme.ejs +0 -67
  143. /package/source/css/{_plugins/comments → comments}/beaudar.styl +0 -0
  144. /package/source/css/{_plugins/comments → comments}/utterances.styl +0 -0
  145. /package/source/css/{_plugins/comments → comments}/waline.styl +0 -0
  146. /package/source/css/{_plugins → plugins}/fancybox.styl +0 -0
@@ -2,6 +2,10 @@
2
2
  border-radius: $border-image
3
3
  &.top
4
4
  border-radius: $border-card-l
5
+ // 背景图同时作为横幅自身背景承载(跟随 corner-shape),子图保留用于 hover 滤镜
6
+ background-image: var(--bg-url)
7
+ background-size: cover
8
+ background-position: center
5
9
  position: relative
6
10
  overflow: hidden
7
11
  display: flex
@@ -15,12 +19,15 @@
15
19
  z-index: 0
16
20
  .content
17
21
  z-index: 1
22
+ position: relative
18
23
  width: 100%
19
24
  height: 100%
20
25
  display: flex
21
26
  flex-direction: column
22
27
  justify-content: space-between
23
28
  .top
29
+ // 文字区保持在背景图(img.bg z-index 0)之上
30
+ z-index: 1
24
31
  display: flex
25
32
  justify-content: space-between
26
33
  align-items: center
@@ -37,7 +44,8 @@
37
44
  .link
38
45
  margin: 0
39
46
  border-radius: 4px
40
- color: rgba(white, 0.8)
47
+ color: var(--text-banner-theme, var(--text-banner))
48
+ opacity: .8
41
49
  padding: 2px 6px
42
50
  background: none
43
51
  line-height: 1.5
@@ -48,10 +56,12 @@
48
56
  &:after
49
57
  content: none
50
58
  &:hover
51
- color: white
59
+ color: var(--text-banner-theme, var(--text-banner))
60
+ opacity: 1
52
61
  background: rgba(white, 0.25)
53
62
  &.active
54
- color: white
63
+ color: var(--text-banner-theme, var(--text-banner))
64
+ opacity: 1
55
65
  background: rgba(white, 0.25)
56
66
 
57
67
  .back
@@ -64,7 +74,7 @@
64
74
  svg
65
75
  width: 20px
66
76
  height: 20px
67
- fill: white
77
+ fill: var(--text-banner-theme, var(--text-banner))
68
78
  .banner-link
69
79
  position: absolute
70
80
  top: 0
@@ -91,13 +101,17 @@
91
101
  width: 48px
92
102
  height: 48px
93
103
  .bottom
104
+ // 同 .top:文字区保持在背景图之上
105
+ z-index: 1
94
106
  display: flex
95
107
  padding: 1rem
96
108
  width: 100%
97
109
  box-sizing: border-box
98
110
  .title
99
111
  font-size: 1.5rem
100
- font-weight: 600
112
+ font-weight: 700
113
+ // 与封面 headline 同款描边,避免标题在复杂背景上发虚
114
+ text-shadow: 0 2px 4px rgba(0,0,0,0.2)
101
115
  .avatar+.text-area
102
116
  margin-left: 0.75rem
103
117
  .text-area .text
@@ -108,26 +122,54 @@
108
122
  font-size: 1.2rem
109
123
  .subtitle
110
124
  font-size: $fs-14
125
+ color: var(--text-banner-theme, var(--text-banner))
111
126
  .content:only-child
112
127
  color: var(--text-p1)
113
128
  .bg+.content
114
- color: white
129
+ --text-banner: white
130
+ color: var(--text-banner)
115
131
  .avatar
116
- border: 2px solid white
132
+ border: 2px solid var(--text-banner)
117
133
  margin: 0
118
134
  .bottom
119
- background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2))
120
135
  text-shadow: 0 0 1px rgba(0,0,0,0.12)
121
136
 
122
137
  .tag-plugin.banner
123
- trans1(transform, 2s)
138
+ // 内容区用绝对定位铺满整卡:避免 flex 百分比高度(height: 100%)在不同浏览器解析不一致,
139
+ // 导致 .top/.bottom 无法贴顶/贴底(navbar 掉到中间)
140
+ .content
141
+ position: absolute
142
+ top: 0
143
+ left: 0
144
+ right: 0
145
+ bottom: 0
146
+ // banner 标签不使用渐变模糊覆盖层(cover-overlay 仅用于封面/页顶 banner):
147
+ // 纯背景图 + 自适应文字颜色,hover 保留背景图放大与变暗
148
+ --img-br: 100%
149
+ --img-sat: 100%
150
+ --cover-zoom: 1.05
124
151
  &:hover
152
+ --img-br: 75%
153
+ --img-sat: 120%
125
154
  img.bg
126
- transform: scale(1.01)
155
+ transform: scale(var(--cover-zoom))
156
+ img.bg
157
+ filter: brightness(var(--img-br)) saturate(var(--img-sat))
158
+ // 封面放大用 1.5s 缓动,其余属性(亮度/饱和度)保持主题默认 0.2s
159
+ transition: all .2s ease-out, transform 1.5s ease-out
160
+ -moz-transition: all .2s ease-out, transform 1.5s ease-out
161
+ -webkit-transition: all .2s ease-out, transform 1.5s ease-out
162
+ -o-transition: all .2s ease-out, transform 1.5s ease-out
127
163
 
128
164
  .tag-plugin.banner .navbar a.active
129
- blur-effect()
165
+ // 不使用 blur-effect()(backdrop-filter):banner 是 overflow:hidden + 圆角/连续曲率的裁剪容器,
166
+ // backdrop-filter 在部分浏览器(Safari / 旧版 Chromium)会破坏父级圆角裁剪,
167
+ // hover 放大背景图时四角变直角;改用与 hover 一致的半透明白底
168
+ background: rgba(white, 0.25)
169
+ &:hover
170
+ background-color: var(--card)
130
171
 
131
172
  @media screen and (max-width: $device-mobile-max)
132
173
  .banner.top
133
174
  border-radius: 0
175
+ clip-path: none
@@ -67,96 +67,15 @@
67
67
  display: block
68
68
  width: 64px
69
69
  height: 64px
70
-
71
-
72
- .previews
73
- display: flex
74
- justify-content: space-between
75
- flex-direction: column
76
- height: 100%
77
- position: relative
78
- .empty
79
- min-height: 1rem
80
- .desc
81
- font-size: 1.2rem
82
- color: var(--text-p3)
83
- font-weight: 400
84
- margin: 1rem 0
85
- margin-right: auto
86
- position: relative
87
- &:before
88
- position: absolute
89
- font-weight: 900
90
- font-size: 32px
91
- color: var(--block-border)
92
- top: 0
93
- content: '“'
94
- left: -16px
95
- trans1 all
96
- .spacer
97
- height: 100%
98
- .posts
99
- margin: 0.5rem 0 1rem 0
100
- display: flex
101
- flex-direction: column
102
- align-items: flex-start
103
- .post-link
104
- display: flex
105
- flex-direction: column
106
- color: var(--text-p1)
107
- position: relative
108
- trans1 color
109
- &+.post-link
110
- margin-top: 1rem
111
- &:before
112
- content: ''
113
- position: absolute
114
- left: -12px
115
- top: 2px
116
- height: 'calc(%s - 2px)' % $fs-14
117
- width: 4px
118
- border-radius: 4px
119
- background: var(--block-border)
120
- trans1 all
121
- &:hover:before
122
- background: var(--accent)
123
- // height: calc(100% - 4px)
124
- height: 100%
125
- top: 0
126
- span
127
- display: -webkit-box
128
- -webkit-box-orient: vertical
129
- overflow: hidden
130
- -webkit-line-clamp: 1
131
- position: relative
132
- .title
133
- font-size: $fs-14
134
- font-weight: 500
135
- max-width: 100%
136
- display: -webkit-box
137
- -webkit-box-orient: vertical
138
- overflow: hidden
139
- -webkit-line-clamp: 2
140
- position: relative
141
- .date
142
- font-size: $fs-12
143
- color: var(--text-p3)
144
- margin-top: 0.25rem
145
- .no-post
146
- font-size: $fs-13
147
- color: var(--text-p4)
148
-
149
-
150
70
  // transform
151
71
  .users-posts-wrap .user-post-card
152
72
  &:hover
153
- .desc
154
- &:before
155
- color: var(--accent)
156
- transform: scale(1.2) translateX(-4px)
73
+ .post-panel
74
+ .desc
75
+ &:before
76
+ color: var(--accent)
77
+ transform: scale(1.2) translateX(-4px)
157
78
  .card-link:hover
158
79
  .lazy-box
159
80
  transform: scale(1.2) rotate(8deg)
160
81
  box-shadow: $boxshadow-card-float
161
- .post-link:hover
162
- color: var(--accent)
@@ -94,6 +94,9 @@
94
94
  aspect-ratio: 2 / 3
95
95
  .grid-cell
96
96
  background: var(--block)
97
+ >.lazy-box
98
+ width: 100%
99
+ height: 100%
97
100
  img
98
101
  width: 100%
99
102
  height: 100%
@@ -2,8 +2,8 @@
2
2
  display: flex
3
3
  flex-direction: column
4
4
  align-items: center
5
- padding-top: var(--gap-padding)
6
- padding-bottom: var(--gap-padding)
5
+ padding-top: var(--gap-base)
6
+ padding-bottom: var(--gap-base)
7
7
  >.content
8
8
  border-left: 1px dashed var(--text-meta)
9
9
  border-right: 1px dashed var(--text-meta)
@@ -95,4 +95,4 @@
95
95
  p
96
96
  margin: 0
97
97
  >.title
98
- border-top: 1px solid var(--text-meta)
98
+ border-top: 1px solid var(--text-meta)
@@ -2,8 +2,8 @@
2
2
  display: flex
3
3
  flex-direction: column
4
4
  align-items: center
5
- padding-top: var(--gap-padding)
6
- padding-bottom: var(--gap-padding)
5
+ padding-top: var(--gap-base)
6
+ padding-bottom: var(--gap-base)
7
7
  >.content
8
8
  display: flex
9
9
  flex-direction: column
@@ -22,7 +22,7 @@
22
22
  >.body
23
23
  overflow: auto
24
24
  scrollbar()
25
- margin: 'calc(%s - 4px) %s' % var(--gap-padding)
25
+ margin: 'calc(%s - 4px) %s' % var(--gap-base)
26
26
  .main
27
27
  p
28
28
  margin: 0;
@@ -100,4 +100,4 @@
100
100
  top: calc(100% + 1rem - 6px)
101
101
  bottom: calc(-1rem - 6px)
102
102
  border-radius: 4px
103
- background: var(--accent)
103
+ background: var(--accent)
@@ -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
@@ -194,6 +194,10 @@ aside .tag-plugin.timeline[data-api] .body .lazy-box
194
194
  display: flex
195
195
  align-items: center
196
196
  border-color: var(--link)
197
+ svg
198
+ width: 1em
199
+ height: 1em
200
+ vertical-align: -0.125em
197
201
  &:first-child
198
202
  margin-left: 0
199
203
  &:last-child
@@ -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
@@ -14,7 +14,7 @@
14
14
  z-index 1
15
15
  margin-top: 0.25rem
16
16
  .header
17
- margin: 0.25rem var(--gap-padding)
17
+ margin: 0.25rem var(--gap-base)
18
18
  .user-info
19
19
  background: none
20
20
  padding-right: 0
@@ -22,7 +22,7 @@
22
22
  display: none
23
23
 
24
24
  .header:before
25
- left: calc(6px - var(--gap-padding))
25
+ left: calc(6px - var(--gap-base))
26
26
  .body
27
27
  border-radius: $border-card
28
28
  padding: 0.5rem 1rem
@@ -31,7 +31,7 @@
31
31
  margin: 0
32
32
  list-style: none
33
33
  a
34
- --padding: calc(var(--gap-padding) / 2)
34
+ --padding: calc(var(--gap-base) / 2)
35
35
  --padding-offset: calc(0 - var(--padding))
36
36
  padding: 4px var(--padding)
37
37
  margin: 0 var(--padding)
@@ -61,7 +61,7 @@
61
61
  top: 0
62
62
  padding: 1rem 0
63
63
  &:first-child
64
- top: var(--gap-margin)
64
+ top: var(--gap-page)
65
65
  padding-top: 1rem
66
66
  .widget-body .toc
67
67
  max-height: 70vh
@@ -142,14 +142,14 @@
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)
149
149
  top: 0
150
150
  height: 1px
151
- left: var(--gap-padding)
152
- right: var(--gap-padding)
151
+ left: var(--gap-base)
152
+ right: var(--gap-base)
153
153
  .widget-wrapper.toc .widget-footer
154
154
  margin-top: 8px
155
155
  color: var(--text-p2)
@@ -160,12 +160,18 @@
160
160
  align-items: center
161
161
  color: inherit
162
162
  font-size: $fs-14
163
- padding: 8px var(--gap-padding)
163
+ padding: 8px var(--gap-base)
164
164
  border-radius: $border-bar
165
165
  trans1 all
166
- svg,img
166
+ svg
167
+ width: 16px
168
+ height: 16px
169
+ flex-shrink: 0
170
+ margin-right: 8px
171
+ img
167
172
  height: 16px
168
173
  width: auto
174
+ flex-shrink: 0
169
175
  margin-right: 8px
170
176
  a:hover
171
177
  background: var(--block-border)
@@ -10,11 +10,11 @@
10
10
  scrollbar(0, 0)
11
11
  z-index: 1
12
12
  line-height: 1.2
13
- margin: 0 var(--gap-margin)
13
+ margin: 0 var(--gap-base)
14
14
  .widget-wrapper
15
15
  .widget-header
16
- padding-left: var(--gap-padding)
17
- padding-right: var(--gap-padding)
16
+ padding-left: var(--gap-base)
17
+ padding-right: var(--gap-base)
18
18
  display: flex
19
19
  justify-content: space-between
20
20
  align-items: baseline
@@ -64,19 +64,20 @@
64
64
  .l_left .widgets
65
65
  padding-bottom: 64px
66
66
  .l_right .widgets
67
- padding: 16px 0
67
+ padding: 0
68
68
  &:empty
69
69
  display: none
70
70
  .widget-wrapper:first-child
71
71
  margin-top: 0
72
72
  .widget-wrapper
73
73
  .widget-header
74
- padding-left: var(--gap-padding)
75
- padding-right: var(--gap-padding)
74
+ padding-left: var(--gap-base)
75
+ padding-right: var(--gap-base)
76
76
  // 小屏幕
77
77
  @media screen and (max-width: $device-laptop)
78
+ padding: var(--gap-base) 0
78
79
  .widget-wrapper
79
- margin-top: var(--gap-margin)
80
+ margin-top: var(--gap-base)
80
81
  border-radius: $border-card-s
81
82
  // 大屏幕
82
83
  @media screen and (min-width: $device-laptop)
@@ -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'))
@@ -75,10 +64,14 @@ $corner-shape = convert(hexo-config('style.corner-shape'))
75
64
 
76
65
  // 侧边栏文字内容宽度
77
66
  --side-content-width: 224px
78
- // 元素轮廓到容器边缘的间距
79
- --gap-margin: 16px
80
- // 元素文本内容到元素自身的轮廓的间距
81
- --gap-padding: 16px
67
+ // 组件内部基础间距(margin/padding 统一)
68
+ --gap-base: 16px
69
+ // 页面级留白(侧边栏/内容区/列间距),笔记本及以上放宽
70
+ --gap-page: 16px
71
+ @media screen and (min-width: $device-laptop)
72
+ --gap-page: 32px
73
+ // 右栏宽度增量(在 --width-sidebar 基础上加宽)
74
+ --rightbar-width-extra: calc(var(--gap-base) * 2)
82
75
 
83
76
  --gap-p: 'calc(%s + 4px)' % $fs-body // gap for paragraph
84
77
  --gap-p-compact: 'calc(%s * 0.75)' % $fs-body
@@ -94,11 +87,6 @@ $corner-shape = convert(hexo-config('style.corner-shape'))
94
87
  @media screen and (max-width: $device-mobile-max)
95
88
  --side-content-width: 224px
96
89
 
97
- // 动态计算值
98
- :root
99
- // 元素文本内容到容器边缘的间距
100
- --gap-max: calc(var(--gap-margin) + var(--gap-padding))
101
-
102
90
  // shadow
103
91
  $boxshadow-card = 0 1px 2px 0px rgba(0, 0, 0, 0.1)
104
92
  $boxshadow-float = 0 4px 8px 0px rgba(0, 0, 0, 0.05)
@@ -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'
@@ -10,6 +10,7 @@ img:not([src])
10
10
 
11
11
  .lazy-box
12
12
  position: relative
13
+ display: block
13
14
  overflow: hidden
14
15
  line-height: 0
15
16
  &.async // 通过 data-service 异步创建的懒加载元素,没办法知道宽高
@@ -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;