clarity-theme 0.1.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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +276 -0
  3. package/README.zh-CN.md +297 -0
  4. package/app/app.config.ts +110 -0
  5. package/app/app.vue +5 -0
  6. package/app/assets/css/_variable.scss +8 -0
  7. package/app/assets/css/animation.scss +50 -0
  8. package/app/assets/css/article.scss +152 -0
  9. package/app/assets/css/color.scss +58 -0
  10. package/app/assets/css/font.scss +35 -0
  11. package/app/assets/css/main.scss +230 -0
  12. package/app/assets/css/reusable.scss +186 -0
  13. package/app/assets/icons/solar-rewind-back-bold-duotone.svg +1 -0
  14. package/app/assets/icons/solar-rewind-forward-bold-duotone.svg +1 -0
  15. package/app/components/blog/BlogAside.vue +63 -0
  16. package/app/components/blog/BlogFooter.vue +61 -0
  17. package/app/components/blog/BlogHeader.global.vue +146 -0
  18. package/app/components/blog/BlogPanel.vue +79 -0
  19. package/app/components/blog/BlogSidebar.vue +160 -0
  20. package/app/components/blog/BlogWidget.vue +134 -0
  21. package/app/components/blog/Mask.vue +42 -0
  22. package/app/components/blog/SkipToContent.vue +22 -0
  23. package/app/components/blog/ThemeToggle.vue +50 -0
  24. package/app/components/content/Alert.vue +96 -0
  25. package/app/components/content/Badge.vue +90 -0
  26. package/app/components/content/Blur.vue +22 -0
  27. package/app/components/content/CardList.vue +32 -0
  28. package/app/components/content/Chat.vue +79 -0
  29. package/app/components/content/Copy.vue +134 -0
  30. package/app/components/content/EmojiClock.vue +53 -0
  31. package/app/components/content/FeedCard.vue +212 -0
  32. package/app/components/content/FeedGroup.vue +130 -0
  33. package/app/components/content/Folding.vue +69 -0
  34. package/app/components/content/Key.vue +164 -0
  35. package/app/components/content/LinkBanner.vue +59 -0
  36. package/app/components/content/LinkCard.vue +74 -0
  37. package/app/components/content/MdTitle.vue +26 -0
  38. package/app/components/content/Mermaid.vue +133 -0
  39. package/app/components/content/MusicScore.vue +178 -0
  40. package/app/components/content/Pic.vue +55 -0
  41. package/app/components/content/Poetry.vue +41 -0
  42. package/app/components/content/ProseA.vue +40 -0
  43. package/app/components/content/ProseCode.vue +95 -0
  44. package/app/components/content/ProsePre.vue +291 -0
  45. package/app/components/content/ProseTable.vue +70 -0
  46. package/app/components/content/Quote.vue +51 -0
  47. package/app/components/content/Tab.vue +100 -0
  48. package/app/components/content/Timeline.vue +73 -0
  49. package/app/components/content/Tip.vue +52 -0
  50. package/app/components/content/VideoEmbed.vue +127 -0
  51. package/app/components/partial/Button.vue +98 -0
  52. package/app/components/partial/DlGroup.vue +69 -0
  53. package/app/components/partial/Dropdown.vue +54 -0
  54. package/app/components/partial/Error.vue +70 -0
  55. package/app/components/partial/Expand.vue +51 -0
  56. package/app/components/partial/IconNavList.vue +42 -0
  57. package/app/components/partial/Pagination.vue +113 -0
  58. package/app/components/partial/RadioGroup.vue +77 -0
  59. package/app/components/partial/Secret.vue +23 -0
  60. package/app/components/partial/Slider.vue +96 -0
  61. package/app/components/partial/Toggle.vue +70 -0
  62. package/app/components/popover/Lightbox.vue +77 -0
  63. package/app/components/popover/Search.vue +214 -0
  64. package/app/components/popover/SearchItem.vue +64 -0
  65. package/app/components/post/Archive.vue +104 -0
  66. package/app/components/post/Article.vue +138 -0
  67. package/app/components/post/Comment.vue +275 -0
  68. package/app/components/post/Excerpt.vue +66 -0
  69. package/app/components/post/OrderToggle.vue +101 -0
  70. package/app/components/post/PostFooter.vue +80 -0
  71. package/app/components/post/PostHeader.vue +147 -0
  72. package/app/components/post/PostSurround.vue +111 -0
  73. package/app/components/post/Slide.vue +215 -0
  74. package/app/components/util/Date.vue +62 -0
  75. package/app/components/util/HydrateSafe.vue +10 -0
  76. package/app/components/util/Img.vue +38 -0
  77. package/app/components/util/Link.vue +11 -0
  78. package/app/components/widget/BlogLog.vue +27 -0
  79. package/app/components/widget/BlogStats.vue +39 -0
  80. package/app/components/widget/BlogTech.vue +65 -0
  81. package/app/components/widget/Empty.vue +3 -0
  82. package/app/components/widget/Toc.vue +129 -0
  83. package/app/composables/useArticle.ts +118 -0
  84. package/app/composables/useAvoid.ts +87 -0
  85. package/app/composables/useCopy.ts +21 -0
  86. package/app/composables/usePagination.ts +70 -0
  87. package/app/composables/useShiki.ts +129 -0
  88. package/app/composables/useToc.ts +57 -0
  89. package/app/composables/useWidgets.ts +56 -0
  90. package/app/error.vue +34 -0
  91. package/app/layouts/default.vue +66 -0
  92. package/app/pages/[...slug].vue +59 -0
  93. package/app/pages/archive.vue +207 -0
  94. package/app/pages/index.vue +83 -0
  95. package/app/pages/link.vue +65 -0
  96. package/app/pages/preview.vue +59 -0
  97. package/app/plugins/easter-egg.ts +23 -0
  98. package/app/plugins/init.ts +6 -0
  99. package/app/plugins/tippy.ts +22 -0
  100. package/app/shiki.config.ts +8 -0
  101. package/app/stores/layout.ts +34 -0
  102. package/app/stores/search.ts +37 -0
  103. package/app/types/article.ts +16 -0
  104. package/app/types/feed.ts +1 -0
  105. package/app/types/index.ts +14 -0
  106. package/app/types/modal.ts +16 -0
  107. package/app/types/nav.ts +11 -0
  108. package/app/utils/anim.ts +37 -0
  109. package/app/utils/img.ts +83 -0
  110. package/config/app.ts +88 -0
  111. package/config/content.d.mts +1 -0
  112. package/config/content.mjs +69 -0
  113. package/config/content.ts +91 -0
  114. package/config/define.mjs +21 -0
  115. package/config/define.ts +23 -0
  116. package/config/feed.ts +42 -0
  117. package/config/feeds.empty.ts +4 -0
  118. package/config/index.d.mts +1 -0
  119. package/config/index.mjs +6 -0
  120. package/config/index.ts +6 -0
  121. package/config/public.ts +71 -0
  122. package/config/schema.d.mts +1 -0
  123. package/config/schema.mjs +103 -0
  124. package/config/schema.ts +129 -0
  125. package/config/server.ts +35 -0
  126. package/img/index.d.mts +1 -0
  127. package/img/index.mjs +78 -0
  128. package/img/index.ts +8 -0
  129. package/modules/clarity-config/anti-mirror-client.ts +11 -0
  130. package/modules/clarity-config/index.ts +324 -0
  131. package/nuxt.config.ts +225 -0
  132. package/package.json +148 -0
  133. package/public/assets/atom.css +274 -0
  134. package/public/assets/atom.xsl +110 -0
  135. package/public/fonts/AlimamaFangYuanTi.woff2 +0 -0
  136. package/remark-plugins/rehype-meta-slots.d.mts +1 -0
  137. package/remark-plugins/rehype-meta-slots.mjs +49 -0
  138. package/remark-plugins/rehype-meta-slots.ts +58 -0
  139. package/remark-plugins/remark-code-component.d.mts +1 -0
  140. package/remark-plugins/remark-code-component.mjs +25 -0
  141. package/remark-plugins/remark-code-component.ts +41 -0
  142. package/server/api/stats.get.ts +109 -0
  143. package/server/routes/atom.xml.get.ts +101 -0
  144. package/server/routes/subscriptions.opml.get.ts +70 -0
  145. package/server/utils/clarity.ts +11 -0
  146. package/shared/types/content.ts +30 -0
  147. package/shared/utils/clarity.ts +34 -0
  148. package/shared/utils/icon.ts +218 -0
  149. package/shared/utils/link.ts +52 -0
  150. package/shared/utils/str.ts +88 -0
  151. package/shared/utils/time.ts +116 -0
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Clarity Theme UI 默认配置。
3
+ *
4
+ * 站点数据(标题、作者、文章分类等)来自根目录 clarity.config.ts,
5
+ * 由 modules/clarity-config 注入到 appConfig.clarity 中。
6
+ *
7
+ * 消费项目可在自己的 app/app.config.ts 中按需覆盖任意键。
8
+ */
9
+ export default defineAppConfig({
10
+ clarity: {
11
+ // @keep-sorted
12
+ component: {
13
+ alert: {
14
+ /** 默认使用卡片风格还是扁平风格 */
15
+ defaultStyle: 'card' as 'card' | 'flat',
16
+ },
17
+
18
+ codeblock: {
19
+ /** 代码块触发折叠的行数 */
20
+ triggerRows: 32,
21
+ /** 代码块折叠后的行数 */
22
+ collapsedRows: 16,
23
+ /** 启用代码块缩进导航会关闭空格渲染 */
24
+ enableIndentGuide: true,
25
+ /** 代码块缩进导航竖线匹配空格数 */
26
+ indent: 4,
27
+ /** tab 渲染宽度 */
28
+ tabSize: 3,
29
+ },
30
+
31
+ /** 文章开头摘要 */
32
+ excerpt: {
33
+ animation: true,
34
+ caret: '_',
35
+ },
36
+
37
+ /** 精选文章 Slide */
38
+ slide: {
39
+ /** 适合封面图无字时启用 */
40
+ showTitle: true,
41
+ },
42
+
43
+ stats: {
44
+ /** 归档页面每年标题对应的年龄,无需展示时可留空 */
45
+ birthYear: undefined as number | undefined,
46
+ },
47
+ },
48
+
49
+ // @keep-sorted
50
+ footer: {
51
+ /** 侧边栏底部图标导航 */
52
+ iconNav: [] as { icon: string, text: string, url: string }[],
53
+ /** 页脚站点地图 */
54
+ nav: [] as {
55
+ title: string
56
+ items: { icon: string, text: string, url: string }[]
57
+ }[],
58
+ },
59
+
60
+ /** 左侧栏顶部 Logo */
61
+ header: {
62
+ /** 展示标题文本,否则展示纯 Logo */
63
+ showTitle: true,
64
+ emojiTail: [] as string[],
65
+ },
66
+
67
+ /** 友链页面 */
68
+ link: {
69
+ /** 无订阅源展示静音图标 */
70
+ remindNoFeed: true,
71
+ /** 友链分组内随机排序 */
72
+ randomInGroup: true,
73
+ },
74
+
75
+ /** 左侧栏导航 */
76
+ nav: [
77
+ {
78
+ title: '',
79
+ items: [
80
+ { icon: 'tabler:files', text: '文章', url: '/' },
81
+ { icon: 'tabler:link', text: '友链', url: '/link' },
82
+ { icon: 'tabler:archive', text: '归档', url: '/archive' },
83
+ ],
84
+ },
85
+ ],
86
+
87
+ pagination: {
88
+ perPage: 10,
89
+ /** 默认排序方式,需要是 article.order 中的键名 */
90
+ sortOrder: 'date',
91
+ /** 允许(普通/预览/归档)文章列表正序,开启后排序方式左侧图标可切换顺序 */
92
+ allowAscending: false,
93
+ },
94
+
95
+ themes: {
96
+ light: {
97
+ icon: 'tabler:sun',
98
+ tip: '浅色模式',
99
+ },
100
+ system: {
101
+ icon: 'tabler:device-desktop',
102
+ tip: '跟随系统',
103
+ },
104
+ dark: {
105
+ icon: 'tabler:moon',
106
+ tip: '深色模式',
107
+ },
108
+ },
109
+ },
110
+ })
package/app/app.vue ADDED
@@ -0,0 +1,5 @@
1
+ <template>
2
+ <NuxtLayout>
3
+ <NuxtPage />
4
+ </NuxtLayout>
5
+ </template>
@@ -0,0 +1,8 @@
1
+ $breakpoint-phone: 528px;
2
+ $breakpoint-mobile: 768px;
3
+ $breakpoint-widescreen: 1080px;
4
+ $breakpoints: (
5
+ phone: $breakpoint-phone,
6
+ mobile: $breakpoint-mobile,
7
+ widescreen: $breakpoint-widescreen,
8
+ );
@@ -0,0 +1,50 @@
1
+ /* stylelint-disable declaration-no-important */
2
+ :root {
3
+ --max-bezier-to-full: cubic-bezier(0.5, 0, 1, 0.5);
4
+ --max-bezier-to-collapse: cubic-bezier(0, 0.5, 0.5, 1);
5
+ }
6
+
7
+ @keyframes float-in {
8
+ 0% {
9
+ opacity: 0;
10
+ transform: translateY(var(--float-distance, 10%));
11
+ }
12
+
13
+ 100% {
14
+ opacity: 1;
15
+ transform: translateY(0);
16
+ }
17
+ }
18
+
19
+ .float-in-enter-active,
20
+ .float-in-leave-active {
21
+ transition: all var(--delay) !important;
22
+ }
23
+
24
+ .float-in-enter-from,
25
+ .float-in-leave-to {
26
+ opacity: 0;
27
+ transform: translateY(var(--float-distance, 10%));
28
+ }
29
+
30
+ .float-in-move {
31
+ transition: transform var(--delay) !important;
32
+ }
33
+
34
+ .collapse-enter-active,
35
+ .collapse-leave-active {
36
+ contain: paint;
37
+ transition: max-height 0.1s;
38
+ }
39
+
40
+ .collapse-enter-from,
41
+ .collapse-leave-to {
42
+ max-height: 0;
43
+ transition-timing-function: var(--max-bezier-to-collapse);
44
+ }
45
+
46
+ .collapse-enter-to,
47
+ .collapse-leave-from {
48
+ max-height: 50vh;
49
+ transition-timing-function: var(--max-bezier-to-full);
50
+ }
@@ -0,0 +1,152 @@
1
+ .article {
2
+ margin: 1rem;
3
+ line-height: 1.8;
4
+
5
+ p {
6
+ margin: 0.5em 0;
7
+ }
8
+
9
+ > *, > p {
10
+ margin: 1rem 0;
11
+ }
12
+
13
+ :target {
14
+ border-radius: 0.2rem;
15
+ animation: highlight 3s;
16
+
17
+ @keyframes highlight {
18
+ 50% { background-color: var(--c-primary-soft); }
19
+ }
20
+ }
21
+
22
+ >:where(h1, h2, h3, h4, h5, h6) {
23
+ margin: 1.6em 0 0.8em;
24
+ font-family: var(--font-creative);
25
+ font-weight: 550;
26
+ color: var(--c-text);
27
+ }
28
+
29
+ :where(menu, ol, ul):not([class]) {
30
+ margin: 0.5em 0;
31
+ padding-inline-start: 1.5em;
32
+ font-size: 0.9rem;
33
+
34
+ &, ol ol ol {
35
+ list-style: revert;
36
+ }
37
+
38
+ ol, ol ol ol ol {
39
+ list-style-type: lower-alpha;
40
+ }
41
+
42
+ ol ol, ol ol ol ol ol {
43
+ list-style-type: lower-roman;
44
+ }
45
+
46
+ ol, ul {
47
+ margin-top: 0;
48
+ }
49
+
50
+ > li {
51
+ margin: 0.2em 0;
52
+
53
+ &::marker {
54
+ color: var(--c-primary);
55
+ }
56
+ }
57
+ }
58
+
59
+ blockquote {
60
+ padding: 0.2rem 0.8rem;
61
+ border-inline-start: 4px solid var(--c-border);
62
+ border-radius: 4px;
63
+ background-color: var(--c-bg-2);
64
+ font-size: 0.9rem;
65
+
66
+ > .z-codeblock {
67
+ margin: 0 -0.8rem;
68
+ }
69
+ }
70
+
71
+ img {
72
+ height: auto;
73
+ max-width: 100%;
74
+
75
+ &.icon {
76
+ height: 1.4em;
77
+ vertical-align: middle;
78
+ transform: translateY(-0.1em);
79
+ }
80
+
81
+ &:not([class]), &.image {
82
+ display: block;
83
+ margin: 1rem auto;
84
+ border-radius: 0.5rem;
85
+ }
86
+ }
87
+
88
+ hr {
89
+ margin: 3em 0;
90
+ border-top: 0.4em dashed var(--c-border);
91
+ }
92
+
93
+ strong {
94
+ background: linear-gradient(var(--c-primary-soft), var(--c-primary-soft)) no-repeat center bottom / 100% 30%;
95
+ }
96
+
97
+ del {
98
+ opacity: 0.5;
99
+ }
100
+
101
+ &.md-tech > h2 > a::before {
102
+ content: "#";
103
+ color: white;
104
+ }
105
+
106
+ &.md-tech > :where(h2, h3, h4, h5, h6) > a::before {
107
+ content: "";
108
+ margin-inline-end: 0.5em;
109
+ padding: 0 2px;
110
+ border-radius: 0.2rem;
111
+ background-color: var(--c-primary);
112
+ text-autospace: no-autospace;
113
+ }
114
+
115
+ &.md-story {
116
+ h1, h2, h3, h4, h5, h6, .title-like {
117
+ position: relative;
118
+ font-family: var(--font-serif);
119
+ font-weight: bolder;
120
+ text-align: center;
121
+ text-wrap: balance;
122
+ }
123
+
124
+ > h2::before {
125
+ content: "";
126
+ position: absolute;
127
+ width: 2.5em;
128
+ height: 2.5em;
129
+ margin: -0.4em 0 0 -0.7em;
130
+ border-radius: 50%;
131
+ background-image: linear-gradient(var(--c-primary-soft), transparent);
132
+ z-index: -1;
133
+ }
134
+
135
+ > h3::after {
136
+ content: "";
137
+ position: absolute;
138
+ bottom: 0;
139
+ width: 0.4em;
140
+ height: 0.7em;
141
+ background-color: var(--c-primary-soft);
142
+ }
143
+
144
+ > p, :not([class]) > p {
145
+ text-indent: 2em;
146
+
147
+ > [class] {
148
+ text-indent: 0;
149
+ }
150
+ }
151
+ }
152
+ }
@@ -0,0 +1,58 @@
1
+ @mixin dark-theme {
2
+ --c-text: hsl(var(--hue-theme) 0% 100%);
3
+ --c-text-1: hsl(var(--hue-theme) 0% 90%);
4
+ --c-text-2: hsl(var(--hue-theme) 0% 70%);
5
+ --c-text-3: hsl(var(--hue-theme) 0% 50%);
6
+ --c-bg: hsl(var(--hue-theme) 0% 7%);
7
+ --c-bg-1: hsl(var(--hue-theme) 10% 10%);
8
+ --c-bg-2: hsl(var(--hue-theme) 10% 14%);
9
+ --c-bg-3: hsl(var(--hue-theme) 10% 18%);
10
+ --c-bg-soft: hsl(var(--hue-theme) 100% 95% / 15%);
11
+ --c-border: hsl(var(--hue-theme) 10% 20%);
12
+ --c-bg-a50: hsl(var(--hue-theme) 10% 10% / 50%);
13
+ --c-bg-a80: hsl(var(--hue-theme) 10% 10% / 80%);
14
+ --c-primary: hsl(var(--hue-theme) 100% 70%);
15
+ --c-primary-soft: hsl(var(--hue-theme) 100% 60% / 20%);
16
+ --ld-bg-blur: var(--c-bg-a80);
17
+ --ld-bg-card: var(--c-bg-3);
18
+ --ld-bg-active: var(--c-primary-soft);
19
+ --ld-shadow: var(--c-bg-a50);
20
+ }
21
+
22
+ :root,
23
+ .light {
24
+ --hue-theme: 220deg;
25
+ --c-text: hsl(var(--hue-theme) 0% 0%);
26
+ --c-text-1: hsl(var(--hue-theme) 0% 20%);
27
+ --c-text-2: hsl(var(--hue-theme) 0% 40%);
28
+ --c-text-3: hsl(var(--hue-theme) 0% 70%);
29
+ --c-bg: hsl(var(--hue-theme) 0% 100%);
30
+ --c-bg-1: hsl(var(--hue-theme) 20% 98%);
31
+ --c-bg-2: hsl(var(--hue-theme) 10% 95%);
32
+ --c-bg-3: hsl(var(--hue-theme) 10% 92%);
33
+ --c-bg-soft: hsl(var(--hue-theme) 20% 20% / 10%);
34
+ --c-border: hsl(var(--hue-theme) 10% 91%);
35
+ --c-bg-a50: hsl(var(--hue-theme) 20% 98% / 50%);
36
+ --c-bg-a80: hsl(var(--hue-theme) 20% 98% / 80%);
37
+ --c-primary: hsl(var(--hue-theme) 100% 55%);
38
+ --c-primary-soft: hsl(var(--hue-theme) 100% 60% / 15%);
39
+ --c-accent: hsl(180deg 70% 60%);
40
+ --ld-bg-blur: var(--c-bg-1);
41
+ --ld-bg-card: var(--c-bg);
42
+ --ld-bg-active: var(--c-bg);
43
+ --ld-shadow: var(--c-bg-soft);
44
+ --c-success: #5A5;
45
+ --c-success-soft: #3F32;
46
+ --c-warning: #D85;
47
+ --c-warning-soft: #F932;
48
+ --c-error: #D55;
49
+ --c-error-soft: #F332;
50
+
51
+ color-scheme: only light;
52
+ }
53
+
54
+ .dark {
55
+ @include dark-theme;
56
+
57
+ color-scheme: dark;
58
+ }
@@ -0,0 +1,35 @@
1
+ :root {
2
+ --font-basic: "InterVariable", /* Android/Linux */ "sans-serif", /* Firefox */ "Noto Sans SC", sans-serif;
3
+ --font-serif: /* Windows */ "Noto Serif SC-Local", "Noto Serif SC", serif;
4
+ --font-creative: "DOUYINSANSBOLD-GB", "InterVariable", sans-serif;
5
+ --font-stroke-free: "DOUYINSANSBOLD-GB", "Inter", /* macOS */ "Lantinghei SC", /* Windows */ "Microsoft YaHei", sans-serif;
6
+ --font-monospace: "JetBrains Mono", /* Android/Linux */ "monospace", /* Windows */ "Cascadia Code", /* Windows */ "Consolas", /* Apple */ "Monaco", var(--font-basic), monospace;
7
+
8
+ @media (max-resolution: 1.2dppx) {
9
+ --font-basic: "InterVariable", system-ui, sans-serif;
10
+ }
11
+ }
12
+
13
+ @font-feature-values "InterVariable", "Inter" {
14
+ @styleset {
15
+ open-digits: 1;
16
+ disambiguation: 2;
17
+ round-quotes-and-commas: 3;
18
+ disambiguation-except-zero: 4;
19
+ circled-characters: 5;
20
+ squared-characters: 6;
21
+ square-punctuation: 7;
22
+ square-quotes: 8;
23
+ }
24
+ }
25
+
26
+ /* 仅在 Chrome 130+ 启用本地可变字体 */
27
+
28
+ /* autoprefixer: ignore next */
29
+ @supports (box-decoration-break: clone) {
30
+ @font-face {
31
+ font-family: "Noto Serif SC-Local";
32
+ font-weight: 100 900;
33
+ src: local("Noto Serif SC");
34
+ }
35
+ }
@@ -0,0 +1,230 @@
1
+ :root {
2
+ --start: left;
3
+ --end: right;
4
+ --transform-start-far: translateX(-100%);
5
+ --transform-end-far: translateX(100%);
6
+ --delay: 0.2s;
7
+ --z-index-popover: 100;
8
+ --text-shadow-black: 0 0.1em 0.1em #0003, 0 0.1em 0.2em #0003;
9
+ --box-shadow-1: 0 0.1em 0.2em var(--ld-shadow);
10
+ --box-shadow-2: 0 0.2em 0.5em var(--ld-shadow);
11
+ --box-shadow-3: 0 0.5em 1em var(--ld-shadow);
12
+
13
+ overflow-wrap: break-word;
14
+ background-color: var(--c-bg-1);
15
+ font-family: sans-serif;
16
+ font-family: var(--font-basic);
17
+ font-synthesis: style;
18
+ line-height: 1.4;
19
+ text-autospace: normal;
20
+ text-size-adjust: none;
21
+ color: var(--c-text-1);
22
+ transition: color 0.1s, background-color 0.2s;
23
+ scroll-behavior: smooth;
24
+ scroll-padding: 2rem;
25
+ scrollbar-color: var(--c-text-3) transparent;
26
+ font-variant-alternates: styleset(open-digits, disambiguation, round-quotes-and-commas);
27
+ -webkit-tap-highlight-color: var(--c-primary-soft);
28
+
29
+ &:dir(rtl) {
30
+ --start: right;
31
+ --end: left;
32
+ --transform-start-far: translateX(100%);
33
+ --transform-end-far: translateX(-100%);
34
+ }
35
+
36
+ @media (prefers-reduced-motion: reduce) {
37
+ transition: none;
38
+ scroll-behavior: auto;
39
+ }
40
+ }
41
+
42
+ * {
43
+ margin: 0;
44
+ padding: 0;
45
+ border: none;
46
+ }
47
+
48
+ *, ::before, ::after {
49
+ box-sizing: border-box;
50
+ }
51
+
52
+ ::selection {
53
+ background-color: var(--c-primary-soft);
54
+ }
55
+
56
+ a {
57
+ text-decoration: none;
58
+ color: currentcolor;
59
+ }
60
+
61
+ code, pre {
62
+ font-family: var(--font-monospace);
63
+ text-autospace: no-autospace;
64
+ }
65
+
66
+ menu, ol, ul {
67
+ list-style: none;
68
+ }
69
+
70
+ mark {
71
+ background-color: var(--c-primary-soft);
72
+ color: var(--c-primary);
73
+ }
74
+
75
+ button {
76
+ cursor: pointer;
77
+
78
+ > .iconify:only-child {
79
+ display: block;
80
+ }
81
+
82
+ &:disabled {
83
+ cursor: auto;
84
+ }
85
+ }
86
+
87
+ button, input, textarea {
88
+ background: none;
89
+ font: inherit;
90
+ color: currentcolor;
91
+ }
92
+
93
+ // Iconify 图标复用了此类
94
+ :where(.iconify) {
95
+ display: inline-block;
96
+ flex-shrink: 0;
97
+ font-size: 1.2em;
98
+ vertical-align: sub;
99
+ }
100
+
101
+ .rtl-flip:dir(rtl) {
102
+ transform: scaleX(-1);
103
+ }
104
+
105
+ .light .iconify[class*="i-catppuccin:"] {
106
+ filter: invert(0.7) hue-rotate(180deg) saturate(4);
107
+ }
108
+
109
+ /* stylelint-disable-next-line selector-class-pattern */
110
+ .i-simple-icons\:mdnwebdocs {
111
+ transform: scale(0.8);
112
+ }
113
+
114
+ // 图片加载失败 fallback
115
+ img {
116
+ contain: paint;
117
+ display: inline-block;
118
+
119
+ &::before {
120
+ all: initial;
121
+ content: attr(alt); // Firefox 的 ::before content 仅在 alt 不为空时展示且值为 attr(alt) 无法修改
122
+ display: grid;
123
+ place-content: center;
124
+ position: absolute;
125
+ inset: 0;
126
+ padding: 0.5em;
127
+ background-color: var(--c-border);
128
+ font: bold 1.5rem/1.2 var(--font-serif);
129
+ text-align: center;
130
+ color: var(--c-bg-soft);
131
+ cursor: inherit;
132
+ }
133
+ }
134
+
135
+ .katex-display, article > .katex {
136
+ display: block; // ```math 不会包裹 .katex-display
137
+ overflow: auto hidden;
138
+ padding: 1px 0;
139
+ scrollbar-width: thin;
140
+ }
141
+
142
+ .bikariya-overlay {
143
+ position: fixed;
144
+ inset: 0;
145
+ background-color: #0003;
146
+ backdrop-filter: blur(4px);
147
+
148
+ &.v-enter-from,
149
+ &.v-leave-to {
150
+ opacity: 0;
151
+ }
152
+
153
+ &.v-enter-active,
154
+ &.v-leave-active {
155
+ transition: all var(--delay);
156
+ }
157
+ }
158
+
159
+ .tippy-box {
160
+ padding: 0.3em 0.6em;
161
+ border-radius: 0.5em;
162
+ box-shadow: var(--box-shadow-3);
163
+ background-color: var(--ld-bg-card);
164
+ font-size: 0.8rem;
165
+ line-height: 1.4;
166
+ color: var(--c-text-2);
167
+ animation: float-in 0.2s;
168
+
169
+ &[data-state="hidden"] {
170
+ opacity: 0;
171
+ }
172
+
173
+ > .tippy-svg-arrow {
174
+ fill: var(--ld-bg-card);
175
+ pointer-events: none;
176
+ }
177
+ }
178
+
179
+ .shiki > .line > span,
180
+ .shiki > span[style] {
181
+ font-style: var(--shiki-light-font-style);
182
+
183
+ .dark & {
184
+ background-color: var(--shiki-dark-bg) !important; /* stylelint-disable-line declaration-no-important */
185
+ font-style: var(--shiki-dark-font-style);
186
+ color: var(--shiki-dark) !important; /* stylelint-disable-line declaration-no-important */
187
+ }
188
+ }
189
+
190
+ .shiki > .line {
191
+ .indent {
192
+ display: inline-block;
193
+ position: relative;
194
+ left: var(--indent-offset);
195
+ }
196
+
197
+ .indent:empty {
198
+ height: 1.4em;
199
+ height: 1lh;
200
+ vertical-align: bottom;
201
+ }
202
+
203
+ .indent::before {
204
+ content: "";
205
+ position: absolute;
206
+ opacity: 0.15;
207
+ height: 100%;
208
+ border-inline-start: 1px solid currentcolor;
209
+ background-color: currentcolor;
210
+ pointer-events: none;
211
+ }
212
+
213
+ > .space::before,
214
+ >.tab::before {
215
+ display: inline-block;
216
+ opacity: 0.3;
217
+ width: 0;
218
+ pointer-events: none;
219
+ }
220
+
221
+ > .space:is(:first-child, :last-child)::before,
222
+ > :not(.space) + .space:has(+ .space)::before,
223
+ > .space + .space::before {
224
+ content: "·";
225
+ }
226
+
227
+ >.tab::before {
228
+ content: "⇥";
229
+ }
230
+ }