vitepress-theme-element-plus 0.0.7 → 0.0.9

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 (43) hide show
  1. package/README.md +3 -3
  2. package/client/components/A11yTag.vue +29 -29
  3. package/client/components/ApiTyping.vue +54 -54
  4. package/client/components/Backdrop.vue +41 -41
  5. package/client/components/Bili.vue +94 -94
  6. package/client/components/Content.vue +148 -148
  7. package/client/components/DeprecatedTag.vue +19 -19
  8. package/client/components/Doc.vue +181 -181
  9. package/client/components/DocAside.vue +46 -46
  10. package/client/components/DocAsideOutline.vue +87 -87
  11. package/client/components/DocFooter.vue +159 -159
  12. package/client/components/Footer.vue +77 -77
  13. package/client/components/FooterCopyright.vue +27 -27
  14. package/client/components/Layout.vue +156 -156
  15. package/client/components/Link.vue +41 -41
  16. package/client/components/LocalNav.vue +160 -160
  17. package/client/components/Nav.vue +69 -69
  18. package/client/components/NavBar.vue +203 -203
  19. package/client/components/NavBarTitle.vue +83 -75
  20. package/client/components/Sidebar.vue +129 -129
  21. package/client/components/SidebarGroup.vue +51 -51
  22. package/client/components/SidebarItem.vue +303 -302
  23. package/client/components/ThemeToggler.vue +108 -0
  24. package/client/components/VPNavBarSearch.vue +23 -23
  25. package/client/hooks/useBackTop.ts +71 -71
  26. package/client/hooks/useLangs.ts +50 -50
  27. package/client/hooks/useSidebarControl.ts +78 -78
  28. package/client/hooks/useSize.ts +69 -69
  29. package/client/icons/dark.vue +8 -0
  30. package/client/icons/light.vue +8 -0
  31. package/client/utils/client/common.ts +49 -49
  32. package/client/utils/client/outline.ts +113 -113
  33. package/client/utils/common.ts +90 -90
  34. package/index.ts +26 -26
  35. package/package.json +73 -73
  36. package/shared/constants.ts +3 -3
  37. package/styles/base.scss +70 -48
  38. package/styles/code.scss +282 -282
  39. package/styles/doc-content.scss +245 -231
  40. package/styles/index.scss +63 -69
  41. package/styles/tag-content.scss +30 -30
  42. package/client/components/Tag.vue +0 -25
  43. package/client/components/VersionTag.vue +0 -18
@@ -1,231 +1,245 @@
1
- .doc-content {
2
- h1 {
3
- margin-bottom: 2rem;
4
- font-weight: 600;
5
- font-size: 1.9rem;
6
- }
7
-
8
- h2 {
9
- margin-top: 2.25rem;
10
- margin-bottom: 1.25rem;
11
- padding-bottom: .3rem;
12
- line-height: 1.25;
13
- font-size: 1.65rem;
14
- font-weight: 600;
15
- }
16
-
17
- h3 {
18
- font-size: 1.35rem;
19
- margin-top: 2rem;
20
- font-weight: 600;
21
- }
22
-
23
- h4 {
24
- font-size: 1.15rem;
25
- font-weight: 600;
26
- }
27
-
28
- h5 {
29
- font-weight: 600;
30
- }
31
-
32
- h2+h3 {
33
- margin-top: 1.5rem;
34
- }
35
-
36
- p {
37
- margin: 1rem 0;
38
- line-height: 1.7;
39
- }
40
-
41
- a {
42
- font-weight: 500;
43
- text-decoration: inherit;
44
- color: var(--brand-color);
45
- display: inline-flex;
46
- align-items: center;
47
- }
48
-
49
- a .link-icon {
50
- margin-left: .25rem;
51
- height: 1em;
52
- width: 1em;
53
- }
54
-
55
-
56
- h1,
57
- h2,
58
- h3,
59
- h4,
60
- h5,
61
- h6 {
62
- display: flex;
63
- align-items: center;
64
- color: var(--el-text-color-regular);
65
-
66
- // Special case for handling tagged header.
67
- .el-tag,
68
- .vp-tag {
69
- margin-left: 8px;
70
- }
71
- }
72
-
73
- @media screen and (min-width: 480px) {
74
- h1 {
75
- font-size: 2.2rem;
76
- }
77
- }
78
-
79
- div .vp-table {
80
- width: 100%;
81
- overflow-y: hidden;
82
- overflow-x: auto;
83
- margin-bottom: 45px;
84
-
85
- & > table {
86
- border-collapse: collapse;
87
- width: 100%;
88
- background-color: var(--bg-color);
89
- font-size: 14px;
90
- line-height: 1.5em;
91
-
92
- tr {
93
- td:nth-child(2) {
94
- font-family: var(--font-family);
95
- }
96
- }
97
-
98
- th,
99
- td {
100
- white-space: nowrap;
101
- border-top: 1px solid var(--border-color);
102
- border-bottom: 1px solid var(--border-color);
103
- padding: 0.6em 1em;
104
- text-align: left;
105
- max-width: 250px;
106
- white-space: pre-wrap;
107
- }
108
-
109
- thead tr:first-child th {
110
- border-top: none;
111
- }
112
-
113
- tbody tr td:first-child {
114
- font-family: var(--font-family-mono);
115
- }
116
- }
117
- }
118
-
119
- .header-anchor:before {
120
- content: '#';
121
- }
122
-
123
- a.header-anchor {
124
- position: absolute;
125
- margin-top: .125em;
126
- margin-left: -.87em;
127
- padding-right: .23em;
128
- font-size: .85em;
129
- opacity: 0;
130
- }
131
-
132
- h1:hover .header-anchor,h1:focus .header-anchor,h2:hover .header-anchor,h2:focus .header-anchor,h3:hover .header-anchor,h3:focus .header-anchor,h4:hover .header-anchor,h4:focus .header-anchor,h5:hover .header-anchor,h5:focus .header-anchor,h6:hover .header-anchor,h6:focus .header-anchor {
133
- opacity: 1
134
- }
135
-
136
-
137
- .custom-block {
138
- .custom-block-title {
139
- font-weight: 700;
140
- }
141
-
142
- p:not(.custom-block-title) {
143
- font-size: 0.9rem;
144
- }
145
-
146
- &.tip {
147
- padding: 8px 16px;
148
- background-color: var(--block-tip-bg-color);
149
- border-radius: 4px;
150
- border-left: 5px solid var(--el-color-primary);
151
- margin: 20px 0;
152
- }
153
-
154
- &.warning {
155
- padding: 8px 16px;
156
- background-color: var(--block-warning-bg-color);
157
- border-radius: 4px;
158
- border-left: 5px solid var(--el-color-danger);
159
- margin: 20px 0;
160
- }
161
- }
162
-
163
- blockquote {
164
- margin: 1rem 0;
165
- border-left: .2rem solid var(--el-border-color);
166
- padding: .25rem 0 .25rem 1rem;
167
- font-size: 1rem;
168
- color: var(--text-color-lighter)
169
- }
170
-
171
- blockquote>p {
172
- margin: 0
173
- }
174
-
175
- form {
176
- margin: 0
177
- }
178
-
179
- details summary {
180
- margin: 16px 0;
181
- font-size: 18px;
182
- font-weight: 600;
183
- cursor: pointer
184
- }
185
-
186
- figure {
187
- margin: 0
188
- }
189
-
190
- img {
191
- max-width: 100%
192
- }
193
-
194
- ul,
195
- ol {
196
- padding-left: 1.25em;
197
- }
198
-
199
- li>ul,
200
- li>ol {
201
- margin: 0
202
- }
203
-
204
- p,
205
- ol,
206
- ul {
207
- margin: 1rem 0;
208
- line-height: 1.7;
209
- list-style-type: disc
210
- }
211
-
212
- ol>li {
213
- list-style: auto
214
- }
215
-
216
- .ep-task-list {
217
- padding-left: 0;
218
-
219
- &>li {
220
- list-style: none;
221
- }
222
- }
223
-
224
- hr {
225
- margin-top: 20px;
226
- margin-bottom: 20px;
227
- border: 0;
228
- border-top: 1px solid var(--el-border-color-lighter);
229
- }
230
- }
231
-
1
+ .doc-content {
2
+ h1 {
3
+ margin-bottom: 2rem;
4
+ font-weight: 600;
5
+ font-size: 1.9rem;
6
+ }
7
+
8
+ h2 {
9
+ margin-top: 2.25rem;
10
+ margin-bottom: 1.25rem;
11
+ padding-bottom: .3rem;
12
+ line-height: 1.25;
13
+ font-size: 1.65rem;
14
+ font-weight: 600;
15
+ }
16
+
17
+ h3 {
18
+ font-size: 1.35rem;
19
+ margin-top: 2rem;
20
+ font-weight: 600;
21
+ }
22
+
23
+ h4 {
24
+ font-size: 1.15rem;
25
+ font-weight: 600;
26
+ }
27
+
28
+ h5 {
29
+ font-weight: 600;
30
+ }
31
+
32
+ h2+h3 {
33
+ margin-top: 1.5rem;
34
+ }
35
+
36
+ p {
37
+ margin: 1rem 0;
38
+ line-height: 1.7;
39
+ }
40
+
41
+ a {
42
+ font-weight: 500;
43
+ text-decoration: inherit;
44
+ color: var(--vp-c-brand);
45
+ display: inline-flex;
46
+ align-items: center;
47
+ }
48
+
49
+ a .link-icon {
50
+ margin-left: .25rem;
51
+ height: 1em;
52
+ width: 1em;
53
+ }
54
+
55
+
56
+ h1,
57
+ h2,
58
+ h3,
59
+ h4,
60
+ h5,
61
+ h6 {
62
+ display: flex;
63
+ align-items: center;
64
+ color: var(--el-text-color-regular);
65
+
66
+ // Special case for handling tagged header.
67
+ .el-tag,
68
+ .vp-tag {
69
+ margin-left: 8px;
70
+ }
71
+ }
72
+
73
+ @media screen and (min-width: 480px) {
74
+ h1 {
75
+ font-size: 2.2rem;
76
+ }
77
+ }
78
+
79
+ div .vp-table {
80
+ width: 100%;
81
+ overflow-y: hidden;
82
+ overflow-x: auto;
83
+ margin-bottom: 45px;
84
+
85
+ & > table {
86
+ border-collapse: collapse;
87
+ width: 100%;
88
+ background-color: var(--bg-color);
89
+ font-size: 14px;
90
+ line-height: 1.5em;
91
+
92
+ tr {
93
+ td:nth-child(2) {
94
+ font-family: var(--font-family);
95
+ }
96
+ }
97
+
98
+ th,
99
+ td {
100
+ white-space: nowrap;
101
+ border-top: 1px solid var(--border-color);
102
+ border-bottom: 1px solid var(--border-color);
103
+ padding: 0.6em 1em;
104
+ text-align: left;
105
+ max-width: 250px;
106
+ white-space: pre-wrap;
107
+ }
108
+
109
+ thead tr:first-child th {
110
+ border-top: none;
111
+ }
112
+
113
+ tbody tr td:first-child {
114
+ font-family: var(--font-family-mono);
115
+ }
116
+ }
117
+ }
118
+
119
+ .header-anchor:before {
120
+ content: '#';
121
+ }
122
+
123
+ a.header-anchor {
124
+ position: absolute;
125
+ margin-top: .125em;
126
+ margin-left: -.87em;
127
+ padding-right: .23em;
128
+ font-size: .85em;
129
+ opacity: 0;
130
+ }
131
+
132
+ h1:hover .header-anchor,h1:focus .header-anchor,h2:hover .header-anchor,h2:focus .header-anchor,h3:hover .header-anchor,h3:focus .header-anchor,h4:hover .header-anchor,h4:focus .header-anchor,h5:hover .header-anchor,h5:focus .header-anchor,h6:hover .header-anchor,h6:focus .header-anchor {
133
+ opacity: 1
134
+ }
135
+
136
+
137
+ .custom-block {
138
+ .custom-block-title {
139
+ font-weight: 700;
140
+ }
141
+
142
+ p:not(.custom-block-title) {
143
+ font-size: 0.9rem;
144
+ }
145
+
146
+ &.tip {
147
+ padding: 8px 16px;
148
+ background-color: var(--block-tip-bg-color);
149
+ border-radius: 4px;
150
+ border-left: 5px solid var(--el-color-primary);
151
+ margin: 20px 0;
152
+ }
153
+
154
+ &.warning {
155
+ padding: 8px 16px;
156
+ background-color: var(--block-warning-bg-color);
157
+ border-radius: 4px;
158
+ border-left: 5px solid var(--el-color-danger);
159
+ margin: 20px 0;
160
+ }
161
+ }
162
+
163
+ blockquote {
164
+ margin: 1rem 0;
165
+ border-left: .2rem solid var(--el-border-color);
166
+ padding: .25rem 0 .25rem 1rem;
167
+ font-size: 1rem;
168
+ color: var(--text-color-lighter)
169
+ }
170
+
171
+ blockquote>p {
172
+ margin: 0
173
+ }
174
+
175
+ form {
176
+ margin: 0
177
+ }
178
+
179
+ details summary {
180
+ margin: 16px 0;
181
+ font-size: 18px;
182
+ font-weight: 600;
183
+ cursor: pointer
184
+ }
185
+
186
+ figure {
187
+ margin: 0
188
+ }
189
+
190
+ img {
191
+ max-width: 100%
192
+ }
193
+
194
+ ul,
195
+ ol {
196
+ padding-left: 1.25em;
197
+ }
198
+
199
+ li>ul,
200
+ li>ol {
201
+ margin: 0
202
+ }
203
+
204
+ p,
205
+ ol,
206
+ ul {
207
+ margin: 1rem 0;
208
+ line-height: 1.7;
209
+ list-style-type: disc
210
+ }
211
+
212
+ ol>li {
213
+ list-style: auto
214
+ }
215
+
216
+ .ep-task-list {
217
+ padding-left: 0;
218
+ .el-checkbox {
219
+ --el-checkbox-checked-text-color: var(--vp-c-brand);
220
+ cursor: unset;
221
+ }
222
+ .el-checkbox__input {
223
+ cursor: unset;
224
+ }
225
+ .el-checkbox__inner:hover {
226
+ border: var(--el-checkbox-input-border);
227
+ }
228
+ .el-checkbox__input.is-checked .el-checkbox__inner {
229
+ background-color: var(--vp-c-brand);
230
+ border-color: var(--vp-c-brand);
231
+ }
232
+
233
+ &>li {
234
+ list-style: none;
235
+ }
236
+ }
237
+
238
+ hr {
239
+ margin-top: 20px;
240
+ margin-bottom: 20px;
241
+ border: 0;
242
+ border-top: 1px solid var(--el-border-color-lighter);
243
+ }
244
+ }
245
+
package/styles/index.scss CHANGED
@@ -1,69 +1,63 @@
1
- :root {
2
- --vp-layout-max-width: 1680px;
3
- --vp-sidebar-width-small: 266px;
4
- --vp-sidebar-width-mobile: 320px;
5
- --text-color: var(--el-text-color-primary);
6
- --text-color-light: var(--el-text-color-regular);
7
- --text-color-lighter: var(--el-text-color-secondary);
8
- --brand-color: var(--el-color-primary);
9
- --brand-color-light: var(--el-color-primary-light-1);
10
- --bg-brand-color: var(--el-color-primary-light-9);
11
- --bg-color: var(--el-bg-color);
12
- --bg-color-rgb: 255, 255, 255;
13
- --bg-color-soft: #fafafa;
14
- --bg-color-mute: #f2f2f2;
15
- --border-color: var(--el-border-color);
16
- --border-color-light: var(--el-border-color-lighter);
17
- --font-family: var(--el-font-family);
18
- --font-family-mono: "JetBrains Mono", source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
19
- --success-color: var(--el-color-success);
20
- --warning-color: var(--el-color-warning);
21
- --danger-color: var(--el-color-danger);
22
- --vp-screen-max-width: 1362px;
23
- --vp-sidebar-width-mobile: 320px;
24
- --vp-sidebar-width-small: 266px;
25
- --code-font-family: var(--font-family-mono);
26
- --code-font-size: var(--el-font-size-base);
27
- --code-bg-color: var(--el-fill-color-light);
28
- --code-text-color: var(--text-color);
29
- --code-tooltip-bg-color: var(--code-bg-color);
30
- --code-tooltip-color: #0c61c9;
31
- --block-tip-bg-color: rgba(var(--el-color-primary-rgb), .1);
32
- --block-warning-bg-color: rgba(var(--el-color-danger-rgb), .1);
33
- --link-active-bg-color: rgba(var(--el-color-primary-rgb), .1)
34
-
35
- &.dark {
36
- --el-color-primary: #a8b1ff;
37
- }
38
- }
39
-
40
- :root:root {
41
- --vp-nav-height: 55px;
42
- --vp-nav-logo-height: 28px;
43
- --vp-c-brand: var(--el-color-primary);
44
- --vp-c-brand-1: var(--el-color-primary);
45
- --vp-c-bg: var(--el-bg-color);
46
- }
47
- // fix "vitepress-plugin-group-icons"
48
- .vp-code-block-title-bar.vp-code-block-title-bar {
49
- margin: 16px 0px 0px;
50
- }
51
-
52
- .vp-code-group .tabs.tabs {
53
- margin-right: 0px;
54
- margin-left: 0px;
55
- border-radius: 8px 8px 0px 0px;
56
- }
57
-
58
- @media screen and (min-width: 1440px) {
59
- :root {
60
- --vp-sidebar-width-small: 234px;
61
- }
62
- }
63
-
64
- @media screen and (min-width: 1680px) {
65
- :root {
66
- --vp-screen-max-width: 1482px;
67
- --vp-sidebar-width-small: 290px;
68
- }
69
- }
1
+ // #region snippet
2
+ :root {
3
+ --vp-layout-max-width: 1680px;
4
+ --vp-screen-max-width: 1362px;
5
+ --vp-sidebar-width-mobile: 320px;
6
+ --vp-sidebar-width-small: 266px;
7
+ --vp-nav-height: 55px;
8
+ --vp-nav-logo-height: 28px;
9
+ --vp-c-brand: var(--el-color-primary);
10
+ --vp-c-brand-1: var(--vp-c-brand);
11
+ --vp-c-brand-2: var(--el-color-primary);
12
+ --vp-c-brand-3: var(--el-color-primary);
13
+ --vp-c-brand-soft: var(--el-color-primary-light-9);
14
+ --vp-c-bg: var(--el-bg-color);
15
+ --text-color: var(--el-text-color-primary);
16
+ --text-color-light: var(--el-text-color-regular);
17
+ --text-color-lighter: var(--el-text-color-secondary);
18
+ --bg-brand-color: var(--vp-c-brand-soft);
19
+ --bg-color: var(--el-bg-color);
20
+ --border-color: var(--el-border-color);
21
+ --font-family: var(--el-font-family);
22
+ --font-family-mono: "JetBrains Mono", source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
23
+ --code-font-family: var(--font-family-mono);
24
+ --code-font-size: var(--el-font-size-base);
25
+ --code-bg-color: var(--el-fill-color-light);
26
+ --code-text-color: var(--text-color);
27
+ --code-tooltip-bg-color: var(--code-bg-color);
28
+ --code-tooltip-color: #0c61c9;
29
+ --purple-color: #6222c2;
30
+ --purple-color-light: #9065db;
31
+ --block-tip-bg-color: rgba(var(--el-color-primary-rgb), .1);
32
+ --block-warning-bg-color: rgba(var(--el-color-danger-rgb), .1);
33
+ --link-active-bg-color: rgba(var(--el-color-primary-rgb), .1)
34
+ }
35
+
36
+ :root.dark {
37
+ --vp-c-brand: #a8b1ff;
38
+ }
39
+ // #endregion snippet
40
+
41
+ @media screen and (min-width: 1440px) {
42
+ :root {
43
+ --vp-sidebar-width-small: 234px;
44
+ }
45
+ }
46
+
47
+ @media screen and (min-width: 1680px) {
48
+ :root {
49
+ --vp-screen-max-width: 1482px;
50
+ --vp-sidebar-width-small: 290px;
51
+ }
52
+ }
53
+
54
+ // fix "vitepress-plugin-group-icons" problem
55
+ .vp-code-block-title-bar.vp-code-block-title-bar {
56
+ margin: 16px 0px 0px;
57
+ }
58
+
59
+ .vp-code-group .tabs.tabs {
60
+ margin-right: 0px;
61
+ margin-left: 0px;
62
+ border-radius: 8px 8px 0px 0px;
63
+ }
@@ -1,30 +1,30 @@
1
- .vp-tag {
2
- --vp-tag-color: var(--vp-c-brand);
3
- --vp-tag-border-color: var(--vp-c-brand);
4
-
5
- display: inline-block;
6
- padding: 0 7px;
7
- border-radius: 10px;
8
- border: 1px solid var(--vp-tag-border-color);
9
- font-size: var(--el-font-size-extra-small);
10
- color: var(--vp-tag-color);
11
- line-height: 18px;
12
- white-space: nowrap;
13
-
14
- &.beta {
15
- --vp-tag-color: var(--el-color-danger);
16
- --vp-tag-border-color: var(--el-color-danger);
17
- }
18
- &.deprecated {
19
- --vp-tag-color: var(--el-color-warning);
20
- --vp-tag-border-color: var(--el-color-warning);
21
- }
22
- &.a11y {
23
- --vp-tag-color: var(--purple-color);
24
- --vp-tag-border-color: var(--purple-color-light);
25
- }
26
- &.required {
27
- --vp-tag-color: var(--el-color-success);
28
- --vp-tag-border-color: var(--el-color-success);
29
- }
30
- }
1
+ .vp-tag {
2
+ --vp-tag-color: var(--vp-c-brand);
3
+ --vp-tag-border-color: var(--vp-c-brand);
4
+
5
+ display: inline-block;
6
+ padding: 0 7px;
7
+ border-radius: 10px;
8
+ border: 1px solid var(--vp-tag-border-color);
9
+ font-size: var(--el-font-size-extra-small);
10
+ color: var(--vp-tag-color);
11
+ line-height: 18px;
12
+ white-space: nowrap;
13
+
14
+ &.beta {
15
+ --vp-tag-color: var(--el-color-danger);
16
+ --vp-tag-border-color: var(--el-color-danger);
17
+ }
18
+ &.deprecated {
19
+ --vp-tag-color: var(--el-color-warning);
20
+ --vp-tag-border-color: var(--el-color-warning);
21
+ }
22
+ &.a11y {
23
+ --vp-tag-color: var(--purple-color);
24
+ --vp-tag-border-color: var(--purple-color-light);
25
+ }
26
+ &.required {
27
+ --vp-tag-color: var(--el-color-success);
28
+ --vp-tag-border-color: var(--el-color-success);
29
+ }
30
+ }