@vuepress/theme-default 2.0.0-rc.33 → 2.0.0-rc.34

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/lib/client/components/VPDarkIcon.vue +8 -0
  2. package/lib/client/components/{DropdownTransition.vue → VPDropdownTransition.vue} +10 -1
  3. package/lib/client/components/VPEditIcon.vue +12 -0
  4. package/lib/client/components/VPHome.vue +38 -0
  5. package/lib/client/components/VPHomeFeatures.vue +68 -0
  6. package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +16 -2
  7. package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +107 -5
  8. package/lib/client/components/VPLightIcon.vue +28 -0
  9. package/lib/client/components/VPNavbar.vue +127 -0
  10. package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +36 -4
  11. package/lib/client/components/VPNavbarDropdown.vue +319 -0
  12. package/lib/client/components/VPNavbarItems.vue +110 -0
  13. package/lib/client/components/VPPage.vue +66 -0
  14. package/lib/client/components/VPPageMeta.vue +132 -0
  15. package/lib/client/components/VPPageNav.vue +118 -0
  16. package/lib/client/components/VPSidebar.vue +112 -0
  17. package/lib/client/components/VPSidebarItem.vue +169 -0
  18. package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +30 -6
  19. package/lib/client/components/VPToggleColorModeButton.vue +54 -0
  20. package/lib/client/components/VPToggleSidebarButton.vue +92 -0
  21. package/lib/client/components/global/Badge.vue +60 -18
  22. package/lib/client/components/global/CodeGroup.d.ts +1 -0
  23. package/lib/client/components/global/CodeGroup.js +4 -3
  24. package/lib/client/components/global/CodeGroupItem.vue +5 -16
  25. package/lib/client/composables/index.d.ts +4 -0
  26. package/lib/client/composables/index.js +4 -0
  27. package/lib/client/composables/useContributors.d.ts +3 -0
  28. package/lib/client/composables/useContributors.js +14 -0
  29. package/lib/client/composables/useDarkMode.js +1 -1
  30. package/lib/client/composables/useEditLink.d.ts +3 -0
  31. package/lib/client/composables/useEditLink.js +31 -0
  32. package/lib/client/composables/useLastUpdated.d.ts +2 -0
  33. package/lib/client/composables/useLastUpdated.js +17 -0
  34. package/lib/client/composables/useNavbarConfig.d.ts +2 -2
  35. package/lib/client/composables/useNavbarConfig.js +1 -1
  36. package/lib/client/composables/useNavbarRepo.d.ts +2 -2
  37. package/lib/client/composables/useNavbarRepo.js +1 -1
  38. package/lib/client/composables/useNavbarSelectLanguage.d.ts +2 -2
  39. package/lib/client/composables/useNavbarSelectLanguage.js +2 -2
  40. package/lib/client/composables/useNavigate.js +4 -7
  41. package/lib/client/composables/useRelatedLinks.d.ts +8 -0
  42. package/lib/client/composables/useRelatedLinks.js +73 -0
  43. package/lib/client/composables/useSidebarItems.d.ts +10 -9
  44. package/lib/client/composables/useSidebarItems.js +14 -14
  45. package/lib/client/config.js +1 -1
  46. package/lib/client/index.d.ts +1 -0
  47. package/lib/client/index.js +1 -0
  48. package/lib/client/layouts/Layout.vue +111 -18
  49. package/lib/client/layouts/NotFound.vue +1 -1
  50. package/lib/client/styles/_mixins.scss +4 -4
  51. package/lib/client/styles/_variables.module.scss +1 -1
  52. package/lib/client/styles/_variables.scss +1 -0
  53. package/lib/client/styles/code-group.scss +32 -29
  54. package/lib/client/styles/{code.scss → content/code.scss} +55 -31
  55. package/lib/client/styles/{custom-container.scss → content/custom-container.scss} +9 -5
  56. package/lib/client/styles/content/index.scss +4 -0
  57. package/lib/client/styles/content/normalize.scss +39 -0
  58. package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
  59. package/lib/client/styles/external-link-icon.scss +7 -3
  60. package/lib/client/styles/index.scss +2 -13
  61. package/lib/client/styles/layout.scss +3 -203
  62. package/lib/client/styles/normalize.scss +4 -3
  63. package/lib/client/styles/plugins.scss +20 -0
  64. package/lib/client/styles/vars-dark.scss +17 -16
  65. package/lib/client/styles/vars.scss +19 -23
  66. package/lib/client/typings.d.ts +13 -0
  67. package/lib/client/typings.js +1 -0
  68. package/lib/client/utils/{getNavLink.d.ts → getAutoLink.d.ts} +2 -2
  69. package/lib/client/utils/index.d.ts +1 -1
  70. package/lib/client/utils/index.js +1 -1
  71. package/lib/client/utils/isActiveSidebarItem.d.ts +2 -2
  72. package/lib/client/utils/isActiveSidebarItem.js +3 -3
  73. package/lib/node/defaultTheme.js +9 -1
  74. package/lib/node/utils/assignDefaultLocaleOptions.js +1 -1
  75. package/lib/shared/index.d.ts +2 -0
  76. package/lib/shared/index.js +2 -0
  77. package/lib/shared/nav.d.ts +21 -30
  78. package/lib/shared/navbar.d.ts +21 -0
  79. package/lib/shared/navbar.js +1 -0
  80. package/lib/shared/options.d.ts +4 -3
  81. package/lib/shared/page.d.ts +2 -2
  82. package/lib/shared/sidebar.d.ts +26 -0
  83. package/lib/shared/sidebar.js +1 -0
  84. package/package.json +18 -18
  85. package/templates/build.html +2 -0
  86. package/lib/client/components/Home.vue +0 -15
  87. package/lib/client/components/HomeContent.vue +0 -5
  88. package/lib/client/components/HomeFeatures.vue +0 -22
  89. package/lib/client/components/Navbar.vue +0 -80
  90. package/lib/client/components/NavbarDropdown.vue +0 -125
  91. package/lib/client/components/NavbarItems.vue +0 -51
  92. package/lib/client/components/Page.vue +0 -31
  93. package/lib/client/components/PageMeta.vue +0 -220
  94. package/lib/client/components/PageNav.vue +0 -228
  95. package/lib/client/components/Sidebar.vue +0 -18
  96. package/lib/client/components/SidebarItem.vue +0 -86
  97. package/lib/client/components/ToggleColorModeButton.vue +0 -57
  98. package/lib/client/components/ToggleSidebarButton.vue +0 -24
  99. package/lib/client/styles/badge.scss +0 -36
  100. package/lib/client/styles/home.scss +0 -168
  101. package/lib/client/styles/navbar-dropdown.scss +0 -177
  102. package/lib/client/styles/navbar.scss +0 -197
  103. package/lib/client/styles/page.scss +0 -11
  104. package/lib/client/styles/sidebar.scss +0 -128
  105. package/lib/client/styles/transitions.scss +0 -22
  106. /package/lib/client/utils/{getNavLink.js → getAutoLink.js} +0 -0
@@ -1,177 +0,0 @@
1
- @import '_mixins';
2
- @import '_variables';
3
-
4
- .navbar-dropdown-wrapper {
5
- cursor: pointer;
6
-
7
- .navbar-dropdown-title {
8
- display: block;
9
- font-size: 0.9rem;
10
- font-family: inherit;
11
- cursor: inherit;
12
- padding: inherit;
13
- line-height: 1.4rem;
14
- background: transparent;
15
- border: none;
16
- font-weight: 500;
17
- color: var(--c-text);
18
-
19
- &:hover {
20
- border-color: transparent;
21
- }
22
- }
23
-
24
- .navbar-dropdown-title-mobile {
25
- @extend .navbar-dropdown-title;
26
- display: none;
27
- font-weight: 600;
28
- font-size: inherit;
29
- &:hover {
30
- color: var(--c-text-accent);
31
- }
32
- }
33
-
34
- .navbar-dropdown {
35
- .navbar-dropdown-item {
36
- color: inherit;
37
- line-height: 1.7rem;
38
-
39
- .navbar-dropdown-subtitle {
40
- margin: 0.45rem 0 0;
41
- border-top: 1px solid var(--c-border);
42
- padding: 1rem 0 0.45rem 0;
43
- font-size: 0.9rem;
44
-
45
- & > span {
46
- padding: 0 1.5rem 0 1.25rem;
47
- }
48
-
49
- & > a {
50
- font-weight: inherit;
51
- &.route-link-active {
52
- &::after {
53
- display: none;
54
- }
55
- }
56
- }
57
- }
58
-
59
- .navbar-dropdown-subitem-wrapper {
60
- padding: 0;
61
- list-style: none;
62
-
63
- .navbar-dropdown-subitem {
64
- font-size: 0.9em;
65
- }
66
- }
67
-
68
- a {
69
- display: block;
70
- line-height: 1.7rem;
71
- position: relative;
72
- border-bottom: none;
73
- font-weight: 400;
74
- margin-bottom: 0;
75
- padding: 0 1.5rem 0 1.25rem;
76
-
77
- &:hover {
78
- color: var(--c-text-accent);
79
- }
80
-
81
- &.route-link-active {
82
- color: var(--c-text-accent);
83
-
84
- &::after {
85
- content: '';
86
- width: 0;
87
- height: 0;
88
- border-left: 5px solid var(--c-text-accent);
89
- border-top: 3px solid transparent;
90
- border-bottom: 3px solid transparent;
91
- position: absolute;
92
- top: calc(50% - 2px);
93
- left: 9px;
94
- }
95
- }
96
- }
97
-
98
- &:first-child .navbar-dropdown-subtitle {
99
- margin-top: 0;
100
- padding-top: 0;
101
- border-top: 0;
102
- }
103
- }
104
- }
105
-
106
- &.mobile {
107
- &.open .navbar-dropdown-title {
108
- margin-bottom: 0.5rem;
109
- }
110
-
111
- .navbar-dropdown-title {
112
- display: none;
113
- }
114
-
115
- .navbar-dropdown-title-mobile {
116
- display: block;
117
- }
118
-
119
- .navbar-dropdown {
120
- @include dropdown_wrapper;
121
-
122
- .navbar-dropdown-item {
123
- .navbar-dropdown-subtitle {
124
- border-top: 0;
125
- margin-top: 0;
126
- padding-top: 0;
127
- padding-bottom: 0;
128
- }
129
-
130
- .navbar-dropdown-subtitle,
131
- & > a {
132
- font-size: 15px;
133
- line-height: 2rem;
134
- }
135
-
136
- .navbar-dropdown-subitem {
137
- font-size: 14px;
138
- padding-left: 1rem;
139
- }
140
- }
141
- }
142
- }
143
-
144
- &:not(.mobile) {
145
- height: 1.8rem;
146
-
147
- &:hover .navbar-dropdown,
148
- &.open .navbar-dropdown {
149
- // override the inline style.
150
- display: block !important;
151
- }
152
-
153
- &.open:blur {
154
- display: none;
155
- }
156
-
157
- .navbar-dropdown {
158
- display: none;
159
- // Avoid height shaked by clicking
160
- height: auto !important;
161
- box-sizing: border-box;
162
- max-height: calc(100vh - 2.7rem);
163
- overflow-y: auto;
164
- position: absolute;
165
- top: 100%;
166
- right: 0;
167
- background-color: var(--c-bg-navbar);
168
- padding: 0.6rem 0;
169
- border: 1px solid var(--c-border);
170
- border-bottom-color: var(--c-border-dark);
171
- text-align: left;
172
- border-radius: 0.25rem;
173
- white-space: nowrap;
174
- margin: 0;
175
- }
176
- }
177
- }
@@ -1,197 +0,0 @@
1
- @import '_variables';
2
-
3
- .navbar {
4
- --navbar-line-height: calc(
5
- var(--navbar-height) - 2 * var(--navbar-padding-v)
6
- );
7
-
8
- padding: var(--navbar-padding-v) var(--navbar-padding-h);
9
- line-height: var(--navbar-line-height);
10
-
11
- .logo {
12
- height: var(--navbar-line-height);
13
- margin-right: var(--navbar-padding-v);
14
- vertical-align: top;
15
- }
16
-
17
- .site-name {
18
- font-size: 1.3rem;
19
- font-weight: 600;
20
- color: var(--c-text);
21
- position: relative;
22
- }
23
-
24
- .navbar-items-wrapper {
25
- display: flex;
26
- position: absolute;
27
- box-sizing: border-box;
28
- top: var(--navbar-padding-v);
29
- right: var(--navbar-padding-h);
30
- height: var(--navbar-line-height);
31
- padding-left: var(--navbar-padding-h);
32
- white-space: nowrap;
33
- font-size: 0.9rem;
34
-
35
- .search-box {
36
- flex: 0 0 auto;
37
- vertical-align: top;
38
- }
39
- }
40
- }
41
-
42
- @media screen and (max-width: $MQMobile) {
43
- .navbar {
44
- padding-left: 4rem;
45
-
46
- .site-name {
47
- display: block;
48
- // 5.5rem for .navbar padding-inline
49
- // 4.5rem for ColorModeSwitch and NavbarSearch
50
- // 1rem for gap
51
- width: calc(100vw - 11rem);
52
- overflow: hidden;
53
- white-space: nowrap;
54
- text-overflow: ellipsis;
55
- }
56
-
57
- .can-hide {
58
- display: none;
59
- }
60
- }
61
- }
62
-
63
- /**
64
- * navbar-items
65
- */
66
- .navbar-items {
67
- display: inline-block;
68
-
69
- @media print {
70
- display: none;
71
- }
72
-
73
- a {
74
- display: inline-block;
75
- line-height: 1.4rem;
76
- color: inherit;
77
-
78
- &:hover,
79
- &.route-link-active {
80
- color: var(--c-text);
81
- }
82
- }
83
-
84
- .navbar-item {
85
- position: relative;
86
- display: inline-block;
87
- margin-left: 1.5rem;
88
- line-height: var(--navbar-line-height);
89
-
90
- &:first-child {
91
- margin-left: 0;
92
- }
93
-
94
- > a {
95
- &:hover,
96
- &.route-link-active {
97
- margin-bottom: -2px;
98
- border-bottom: 2px solid var(--c-text-accent);
99
- }
100
- }
101
- }
102
- }
103
-
104
- @media (max-width: $MQMobile) {
105
- .navbar-items {
106
- .navbar-item {
107
- margin-left: 0;
108
-
109
- > a {
110
- &:hover,
111
- &.route-link-active {
112
- margin-bottom: 0;
113
- border-bottom: none;
114
- }
115
- }
116
- }
117
-
118
- a {
119
- &:hover,
120
- &.route-link-active {
121
- color: var(--c-text-accent);
122
- }
123
- }
124
- }
125
- }
126
-
127
- /**
128
- * toggle sidebar button
129
- */
130
- .toggle-sidebar-button {
131
- position: absolute;
132
- top: 0.6rem;
133
- left: 1rem;
134
- display: none;
135
- padding: 0.6rem;
136
- cursor: pointer;
137
- }
138
-
139
- .toggle-sidebar-button .icon {
140
- display: flex;
141
- flex-direction: column;
142
- justify-content: center;
143
- align-items: center;
144
- width: 1.25rem;
145
- height: 1.25rem;
146
- cursor: inherit;
147
-
148
- span {
149
- display: inline-block;
150
- width: 100%;
151
- height: 2px;
152
- border-radius: 2px;
153
- background-color: var(--c-text);
154
- transition: transform var(--t-transform);
155
-
156
- &:nth-child(2) {
157
- margin: 6px 0;
158
- }
159
- }
160
- }
161
-
162
- @media screen and (max-width: $MQMobile) {
163
- .toggle-sidebar-button {
164
- display: block;
165
- }
166
- }
167
-
168
- /**
169
- * toggle color mode button
170
- */
171
- .toggle-color-mode-button {
172
- display: flex;
173
- margin: auto;
174
- margin-left: 1rem;
175
- border: 0;
176
- background: none;
177
- color: var(--c-text);
178
- opacity: 0.8;
179
- cursor: pointer;
180
-
181
- @media print {
182
- display: none;
183
- }
184
-
185
- &:hover {
186
- opacity: 1;
187
- }
188
-
189
- .icon {
190
- width: 1.25rem;
191
- height: 1.25rem;
192
- }
193
- }
194
-
195
- .DocSearch {
196
- transition: background-color var(--t-color);
197
- }
@@ -1,11 +0,0 @@
1
- @import '_mixins';
2
-
3
- .page {
4
- padding-bottom: 2rem;
5
- display: block;
6
-
7
- .theme-default-content {
8
- @include content_wrapper;
9
- padding-top: 0;
10
- }
11
- }
@@ -1,128 +0,0 @@
1
- @import '_mixins';
2
- @import '_variables';
3
-
4
- .sidebar {
5
- ul {
6
- padding: 0;
7
- margin: 0;
8
- list-style-type: none;
9
- }
10
-
11
- a {
12
- display: inline-block;
13
- }
14
-
15
- .navbar-items {
16
- display: none;
17
- border-bottom: 1px solid var(--c-border);
18
- transition: border-color var(--t-color);
19
- padding: 0.5rem 0 0.75rem 0;
20
-
21
- a {
22
- font-weight: 600;
23
- }
24
-
25
- .navbar-item {
26
- display: block;
27
- line-height: 1.25rem;
28
- font-size: 1.1em;
29
- padding: 0.5rem 0 0.5rem 1.5rem;
30
- }
31
- }
32
-
33
- .sidebar-items {
34
- padding: 1.5rem 0;
35
- }
36
- }
37
-
38
- @media (max-width: $MQMobile) {
39
- .sidebar {
40
- .navbar-items {
41
- display: block;
42
-
43
- .navbar-dropdown-wrapper
44
- .navbar-dropdown
45
- .navbar-dropdown-item
46
- a.route-link-active::after {
47
- top: calc(1rem - 2px);
48
- }
49
- }
50
-
51
- .sidebar-items {
52
- padding: 1rem 0;
53
- }
54
- }
55
- }
56
-
57
- .sidebar-item {
58
- cursor: default;
59
- border-left: 0.25rem solid transparent;
60
- color: var(--c-text);
61
-
62
- &:focus-visible {
63
- outline-width: 1px;
64
- outline-offset: -1px;
65
- }
66
-
67
- &.active:not(p.sidebar-heading) {
68
- font-weight: 600;
69
- color: var(--c-text-accent);
70
- border-left-color: var(--c-text-accent);
71
- }
72
-
73
- &.sidebar-heading {
74
- transition: color 0.15s ease;
75
- font-size: 1.1em;
76
- font-weight: bold;
77
- padding: 0.35rem 1.5rem 0.35rem 1.25rem;
78
- width: 100%;
79
- box-sizing: border-box;
80
- margin: 0;
81
-
82
- + .sidebar-item-children {
83
- @include dropdown_wrapper;
84
- margin-bottom: 0.75rem;
85
- }
86
- }
87
-
88
- &.collapsible {
89
- cursor: pointer;
90
- }
91
-
92
- &:not(.sidebar-heading) {
93
- font-size: 1em;
94
- font-weight: 400;
95
- display: inline-block;
96
- margin: 0;
97
- padding: 0.35rem 1rem 0.35rem 2rem;
98
- line-height: 1.4;
99
- width: 100%;
100
- box-sizing: border-box;
101
-
102
- & + .sidebar-item-children {
103
- padding-left: 1rem;
104
- font-size: 0.95em;
105
- }
106
-
107
- .sidebar-item-children .sidebar-item-children & {
108
- padding: 0.25rem 1rem 0.25rem 1.75rem;
109
-
110
- &.active {
111
- font-weight: 500;
112
- border-left-color: transparent;
113
- }
114
- }
115
-
116
- a.sidebar-heading + .sidebar-item-children &.active {
117
- border-left-color: transparent;
118
- }
119
- }
120
- }
121
-
122
- a.sidebar-item {
123
- cursor: pointer;
124
-
125
- &:hover {
126
- color: var(--c-text-accent);
127
- }
128
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * dropdown
3
- */
4
- .dropdown-enter-from,
5
- .dropdown-leave-to {
6
- height: 0 !important;
7
- }
8
-
9
- /**
10
- * fade-slide-y
11
- */
12
- .fade-slide-y-enter-active {
13
- transition: all 0.2s ease;
14
- }
15
- .fade-slide-y-leave-active {
16
- transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
17
- }
18
- .fade-slide-y-enter-from,
19
- .fade-slide-y-leave-to {
20
- transform: translateY(10px);
21
- opacity: 0;
22
- }