valaxy-theme-yun 0.1.1 → 0.2.1

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 (41) hide show
  1. package/components/YunAlgoliaSearch.vue +10 -10
  2. package/components/YunBackToTop.vue +2 -3
  3. package/components/YunBase.vue +3 -0
  4. package/components/YunBoard.vue +23 -0
  5. package/components/YunCard.vue +1 -1
  6. package/components/YunCategories.vue +12 -7
  7. package/components/YunCategory.vue +25 -13
  8. package/components/YunConfig.vue +2 -10
  9. package/components/YunGirls.vue +2 -3
  10. package/components/YunGoDown.vue +3 -3
  11. package/components/YunOverview.vue +113 -0
  12. package/components/YunPostCollapse.vue +10 -10
  13. package/components/YunPostMeta.vue +23 -1
  14. package/components/YunPostNav.vue +2 -2
  15. package/components/YunSay.vue +6 -5
  16. package/components/YunSidebar.vue +24 -96
  17. package/components/YunSidebarNav.vue +8 -7
  18. package/components/YunSponsor.vue +3 -6
  19. package/components/YunToggleLocale.vue +25 -0
  20. package/components/YunTwikoo.vue +14 -0
  21. package/components/YunWaline.vue +3 -5
  22. package/composables/index.ts +6 -3
  23. package/config/index.ts +62 -4
  24. package/dist/index.d.ts +35 -1
  25. package/dist/index.js +1 -1
  26. package/dist/index.mjs +1 -1
  27. package/index.ts +31 -0
  28. package/layouts/archives.vue +4 -2
  29. package/layouts/base.vue +16 -7
  30. package/layouts/categories.vue +4 -2
  31. package/layouts/home.vue +11 -2
  32. package/layouts/post.vue +5 -1
  33. package/layouts/tags.vue +9 -4
  34. package/locales/en.yml +1 -0
  35. package/locales/zh-CN.yml +1 -0
  36. package/package.json +3 -3
  37. package/styles/css-vars.scss +17 -0
  38. package/styles/layout/index.scss +2 -2
  39. package/styles/layout/post.scss +10 -18
  40. package/styles/markdown.scss +14 -16
  41. package/styles/vars.scss +32 -6
package/layouts/post.vue CHANGED
@@ -13,7 +13,11 @@ const url = useFullUrl()
13
13
  <slot name="header">
14
14
  <YunPostMeta :frontmatter="frontmatter" />
15
15
  </slot>
16
- <router-view />
16
+ <router-view v-slot="{Component}">
17
+ <Transition appear>
18
+ <component :is="Component" />
19
+ </Transition>
20
+ </router-view>
17
21
  <YunSponsor v-if="frontmatter.sponsor || config.sponsor.enable" />
18
22
  <ValaxyCopyright v-if="frontmatter.copyright || config.license.enabled" :url="url" m="y-4" />
19
23
  </main>
package/layouts/tags.vue CHANGED
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { useFrontmatter, useInvisibleElement, usePostList, useTags } from 'valaxy'
2
+ import { useFrontmatter, useInvisibleElement, usePostList, usePostTitle, useTags, useThemeConfig } from 'valaxy'
3
3
  import { useI18n } from 'vue-i18n'
4
4
  import { computed, ref } from 'vue'
5
5
  import { useRoute, useRouter } from 'vue-router'
@@ -7,9 +7,13 @@ import { useRoute, useRouter } from 'vue-router'
7
7
  const route = useRoute()
8
8
  const router = useRouter()
9
9
 
10
+ const themeConfig = useThemeConfig()
11
+
10
12
  const { t } = useI18n()
11
13
  const frontmatter = useFrontmatter()
12
- const { tags, getTagStyle } = useTags()
14
+ const { tags, getTagStyle } = useTags({
15
+ primary: themeConfig.value.colors.primary,
16
+ })
13
17
 
14
18
  const postList = usePostList()
15
19
  const curTag = computed(() => route.query.tag as string || '')
@@ -40,13 +44,14 @@ const displayTag = (tag: string) => {
40
44
  show()
41
45
  }
42
46
 
47
+ const title = usePostTitle(frontmatter)
43
48
  </script>
44
49
 
45
50
  <template>
46
51
  <YunBase>
47
52
  <template #header>
48
53
  <YunPageHeader
49
- :title="frontmatter.title || t('menu.tags')"
54
+ :title="title || t('menu.tags')"
50
55
  :icon="frontmatter.icon || 'i-ri-tag-line'"
51
56
  :color="frontmatter.color"
52
57
  />
@@ -77,7 +82,7 @@ const displayTag = (tag: string) => {
77
82
  color: var(--yun-tag-color);
78
83
 
79
84
  &:hover {
80
- color: var(--yun-c-primary);
85
+ color: var(--va-c-primary);
81
86
  }
82
87
  }
83
88
  </style>
package/locales/en.yml CHANGED
@@ -0,0 +1 @@
1
+ valaxy_theme_yun: Valaxy Theme Yun
package/locales/zh-CN.yml CHANGED
@@ -0,0 +1 @@
1
+ valaxy_theme_yun: Valaxy 主题 云
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "repository": {
@@ -10,7 +10,7 @@
10
10
  "homepage": "https://valaxy.yyj.moe/",
11
11
  "dependencies": {
12
12
  "@iconify-json/ant-design": "^1.1.1",
13
- "@iconify-json/simple-icons": "^1.1.6"
13
+ "@iconify-json/simple-icons": "^1.1.7"
14
14
  },
15
15
  "author": {
16
16
  "email": "me@yunyoujun.cn",
@@ -18,7 +18,7 @@
18
18
  "url": "https://www.yunyoujun.cn"
19
19
  },
20
20
  "devDependencies": {
21
- "valaxy": "0.1.1"
21
+ "valaxy": "0.2.1"
22
22
  },
23
23
  "scripts": {
24
24
  "build": "tsup",
@@ -0,0 +1,17 @@
1
+ @use './vars' as *;
2
+ @use '~/styles/mixins' as * with(
3
+ $namespace: 'yun'
4
+ );
5
+
6
+ :root {
7
+ @include set-css-var-from-map($common);
8
+ @include set-css-var-from-map($z-index, 'z');
9
+ }
10
+
11
+ :root {
12
+ @include set-css-var-from-map($light);
13
+ }
14
+
15
+ html.dark {
16
+ @include set-css-var-from-map($dark);
17
+ }
@@ -2,6 +2,6 @@
2
2
  @use "./post" as *;
3
3
 
4
4
  .yun-main {
5
- padding-left: var(--yun-sidebar-width-mobile);
6
- transition: padding-left var(--yun-transition-duration);
5
+ padding-left: var(--va-sidebar-width-mobile);
6
+ transition: padding-left var(--va-transition-duration);
7
7
  }
@@ -1,13 +1,10 @@
1
- @use 'sass:map';
2
- @use '~/styles/mixins' as *;
3
- @use '~/styles/palette.scss' as *;
1
+ @use "~/styles/mixins" as *;
4
2
 
5
3
  .post-card {
6
4
  position: relative;
7
- max-width: 900px;
5
+ max-width: var(--yun-post-card-max-width);
8
6
  }
9
7
 
10
-
11
8
  .post-title {
12
9
  display: flex;
13
10
  justify-content: center;
@@ -21,7 +18,8 @@
21
18
  .post-title-link {
22
19
  position: relative;
23
20
  padding: 0.7rem 1.2rem;
24
- color: var(--card-c-primary, var(--yun-c-link));
21
+ color: var(--card-c-primary, var(--va-c-link));
22
+ font-weight: 900;
25
23
 
26
24
  .icon {
27
25
  width: 1.6rem;
@@ -29,8 +27,9 @@
29
27
  margin-right: 0.4rem;
30
28
  }
31
29
 
32
- &::before, &::after {
33
- content: '';
30
+ &::before,
31
+ &::after {
32
+ content: "";
34
33
  position: absolute;
35
34
  width: 10px;
36
35
  height: 10px;
@@ -54,20 +53,13 @@
54
53
  transform: translate3d(-10px, -10px, 0);
55
54
  }
56
55
 
57
- &:hover::before, &:hover::after {
56
+ &:hover::before,
57
+ &:hover::after {
58
58
  opacity: 1;
59
59
  transform: translate3d(0, 0, 0);
60
60
  }
61
61
  }
62
62
 
63
- .post-top-icon {
64
- position: absolute;
65
- top: 1rem;
66
- right: 1rem;
67
- color: var(--yun-c-warning);
68
- font-size: 1.2rem;
69
- }
70
-
71
63
  .post-link-btn,
72
64
  .markdown-body .post-link-btn {
73
65
  background-color: var(--card-c-primary);
@@ -78,7 +70,7 @@
78
70
 
79
71
  margin-top: -0.2rem;
80
72
 
81
- transition: box-shadow var(--yun-transition-duration);
73
+ transition: box-shadow var(--va-transition-duration);
82
74
 
83
75
  &:before {
84
76
  content: none;
@@ -1,31 +1,29 @@
1
1
  @use "~/styles/mixins" as *;
2
2
 
3
3
  .markdown-body {
4
- --smc-font-family: var(--yun-font-sans);
5
-
6
- --c-toc-link: var(--yun-c-text-light);
4
+ --c-toc-link: var(--va-c-text-light);
7
5
  }
8
6
 
9
7
  html.dark {
10
8
  .markdown-body {
11
- --smc-header-bottom-color: #333;
12
-
13
- --c-toc-link: var(--yun-c-text-dark);
9
+ --c-toc-link: var(--va-c-text-dark);
14
10
  }
15
11
  }
16
12
 
17
13
  .markdown-body {
18
- ul {
19
- > li {
20
- list-style-type: disc;
21
-
22
- li {
23
- list-style-type: circle;
14
+ h1,
15
+ h2,
16
+ h3,
17
+ h4,
18
+ h5,
19
+ h6 {
20
+ font-family: var(--va-font-serif);
21
+ font-weight: 900;
22
+ }
24
23
 
25
- li {
26
- list-style-type: square;
27
- }
28
- }
24
+ ul {
25
+ li > p {
26
+ margin-bottom: 0;
29
27
  }
30
28
  }
31
29
  }
package/styles/vars.scss CHANGED
@@ -1,7 +1,33 @@
1
- :root {
2
- --yun-sidebar-bg-image: url("https://cdn.jsdelivr.net/gh/YunYouJun/cdn@master/img/bg/alpha-stars-timing-1.webp")
3
- }
1
+ @use 'sass:map';
4
2
 
5
- html.dark {
6
- --yun-sidebar-bg-image: none;
7
- }
3
+ // palette
4
+ $light: () !default;
5
+ $light: map.merge((
6
+ 'bg-image': url('https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/bg/stars-timing-0-blur-30px.jpg'),
7
+ 'sidebar-bg-color': var(--va-c-bg-light),
8
+ 'sidebar-bg-image': url("https://cdn.jsdelivr.net/gh/YunYouJun/cdn@master/img/bg/alpha-stars-timing-1.webp")
9
+ ), $light);
10
+
11
+ $dark: () !default;
12
+ $dark: map.merge((
13
+ 'bg-image': none,
14
+ 'sidebar-bg-image': none
15
+ ), $dark);
16
+
17
+ // common
18
+ $common: () !default;
19
+ $common: map.merge((
20
+ 'post-card-max-width': 900px
21
+ ), $common);
22
+
23
+ $z-index: () !default;
24
+ $z-index: map.merge((
25
+ 'cloud': 8,
26
+ 'go-down': 9,
27
+ 'sidebar': 10,
28
+ 'fireworks': 11,
29
+ 'menu-btn': 20,
30
+ 'go-up-btn': 20,
31
+ 'search-popup': 30,
32
+ 'search-btn': 31,
33
+ ), $z-index);