@sugarat/theme 0.5.12-beta.0 → 0.5.12-beta.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 (39) hide show
  1. package/node.js +1 -1
  2. package/node.mjs +1 -1
  3. package/package.json +1 -2
  4. package/src/components/Alert.vue +123 -162
  5. package/src/components/Avatar.vue +7 -8
  6. package/src/components/BlogAlert.vue +5 -5
  7. package/src/components/BlogApp.vue +1 -8
  8. package/src/components/BlogArticleAnalyze.vue +41 -46
  9. package/src/components/BlogAuthor.vue +13 -15
  10. package/src/components/BlogBackToTop.vue +21 -24
  11. package/src/components/BlogButtonAfterArticle.vue +9 -12
  12. package/src/components/BlogCommentWrapper.vue +34 -41
  13. package/src/components/BlogDocCover.vue +1 -1
  14. package/src/components/BlogFooter.vue +26 -32
  15. package/src/components/BlogFriendLink.vue +38 -47
  16. package/src/components/BlogHomeBanner.vue +25 -31
  17. package/src/components/BlogHomeHeaderAvatar.vue +16 -23
  18. package/src/components/BlogHomeInfo.vue +1 -1
  19. package/src/components/BlogHomeOverview.vue +12 -15
  20. package/src/components/BlogHomeTags.vue +14 -17
  21. package/src/components/BlogHotArticle.vue +66 -77
  22. package/src/components/BlogItem.vue +14 -23
  23. package/src/components/BlogList.vue +12 -15
  24. package/src/components/BlogRecommendArticle.vue +53 -69
  25. package/src/components/BlogSidebar.vue +1 -1
  26. package/src/components/Button.vue +69 -84
  27. package/src/components/Carousel.vue +22 -27
  28. package/src/components/CarouselItem.vue +11 -26
  29. package/src/components/CommentArtalk.vue +1 -1
  30. package/src/components/Image.vue +8 -9
  31. package/src/components/ImageViewer.vue +54 -53
  32. package/src/components/Pagination.vue +148 -176
  33. package/src/components/Tag.vue +72 -91
  34. package/src/components/UserWorks.vue +115 -155
  35. package/src/index.ts +1 -1
  36. package/src/styles/{index.scss → index.css} +56 -91
  37. package/src/styles/scss/algolia.scss +0 -231
  38. package/src/styles/scss/global.scss +0 -156
  39. package/src/styles/scss/highlight.scss +0 -12
@@ -98,7 +98,7 @@ const showChangeBtn = computed(() => {
98
98
  </div>
99
99
  </template>
100
100
 
101
- <style lang="scss" scoped>
101
+ <style scoped>
102
102
  .card {
103
103
  position: relative;
104
104
  margin: 0 auto 10px;
@@ -111,10 +111,9 @@ const showChangeBtn = computed(() => {
111
111
  transition: all 0.3s;
112
112
  background-color: rgba(var(--bg-gradient));
113
113
  display: flex;
114
-
115
- &:hover {
116
- box-shadow: var(--box-shadow-hover);
117
- }
114
+ }
115
+ .card:hover {
116
+ box-shadow: var(--box-shadow-hover);
118
117
  }
119
118
 
120
119
  .card-header {
@@ -122,12 +121,11 @@ const showChangeBtn = computed(() => {
122
121
  width: 100%;
123
122
  justify-content: space-between;
124
123
  align-items: center;
125
-
126
- .title {
127
- font-size: 12px;
128
- display: flex;
129
- align-items: center;
130
- }
124
+ }
125
+ .card-header .title {
126
+ font-size: 12px;
127
+ display: flex;
128
+ align-items: center;
131
129
  }
132
130
 
133
131
  .recommend {
@@ -141,72 +139,63 @@ const showChangeBtn = computed(() => {
141
139
  margin: 0;
142
140
  padding: 0 10px 0 0px;
143
141
  width: 100%;
144
-
145
- li {
146
- display: flex;
147
-
148
- &:nth-child(1) .num {
149
- background-color: #f56c6c;
150
- color: #fff;
151
- font-size: 12px;
152
- border-radius: 8px 0 8px 0;
153
- }
154
-
155
- &:nth-child(2) .num {
156
- background-color: #67c23a;
157
- color: #fff;
158
- font-size: 12px;
159
- border-radius: 0 8px 0 8px;
160
- }
161
-
162
- &:nth-child(3) .num {
163
- background-color: var(--vp-c-brand-2);
164
- color: #fff;
165
- font-size: 12px;
166
- border-radius: 6px;
167
- }
168
-
169
- .num {
170
- display: block;
171
- font-size: 14px;
172
- color: var(--description-font-color);
173
- font-weight: 600;
174
- margin: 6px 12px 10px 0;
175
- width: 18px;
176
- height: 18px;
177
- line-height: 18px;
178
- text-align: center;
179
- }
180
-
181
- .des {
182
- overflow: hidden;
183
- text-overflow: ellipsis;
184
- white-space: nowrap;
185
- }
186
-
187
- .title {
188
- font-size: 14px;
189
- color: var(--vp-c-text-1);
190
- font-weight: 500;
191
- position: relative;
192
- cursor: pointer;
193
- }
194
-
195
- .title:hover::after {
196
- content: "";
197
- position: absolute;
198
- left: 0;
199
- right: 0;
200
- height: 0;
201
- bottom: -3px;
202
- border-bottom: 1px solid #b1b3b8;
203
- }
204
-
205
- .suffix {
206
- font-size: 12px;
207
- color: var(--vp-c-text-2);
208
- }
209
- }
142
+ }
143
+ .recommend-container li {
144
+ display: flex;
145
+ }
146
+ .recommend-container li:nth-child(1) .num {
147
+ background-color: #f56c6c;
148
+ color: #fff;
149
+ font-size: 12px;
150
+ border-radius: 8px 0 8px 0;
151
+ }
152
+ .recommend-container li:nth-child(2) .num {
153
+ background-color: #67c23a;
154
+ color: #fff;
155
+ font-size: 12px;
156
+ border-radius: 0 8px 0 8px;
157
+ }
158
+ .recommend-container li:nth-child(3) .num {
159
+ background-color: var(--vp-c-brand-2);
160
+ color: #fff;
161
+ font-size: 12px;
162
+ border-radius: 6px;
163
+ }
164
+ .recommend-container li .num {
165
+ display: block;
166
+ font-size: 14px;
167
+ color: var(--description-font-color);
168
+ font-weight: 600;
169
+ margin: 6px 12px 10px 0;
170
+ width: 18px;
171
+ height: 18px;
172
+ line-height: 18px;
173
+ text-align: center;
174
+ }
175
+ .recommend-container li .des {
176
+ overflow: hidden;
177
+ text-overflow: ellipsis;
178
+ white-space: nowrap;
179
+ }
180
+ .recommend-container li .title {
181
+ font-size: 14px;
182
+ color: var(--vp-c-text-1);
183
+ font-weight: 500;
184
+ position: relative;
185
+ cursor: pointer;
186
+ }
187
+ .recommend-container li .title:hover::after {
188
+ content: "";
189
+ position: absolute;
190
+ left: 0;
191
+ right: 0;
192
+ height: 0;
193
+ bottom: -3px;
194
+ border-bottom: 1px solid #b1b3b8;
195
+ }
196
+ .recommend-container li .suffix {
197
+ font-size: 12px;
198
+ color: var(--vp-c-text-2);
210
199
  }
211
200
 
212
201
  .empty-text {
@@ -111,7 +111,7 @@ const resultCover = computed(() => {
111
111
  </a>
112
112
  </template>
113
113
 
114
- <style lang="scss" scoped>
114
+ <style scoped>
115
115
  .blog-item .pin {
116
116
  position: absolute;
117
117
  overflow: hidden;
@@ -127,13 +127,11 @@ const resultCover = computed(() => {
127
127
  }
128
128
 
129
129
  .blog-item .pin::before {
130
- content: '';
130
+ content: "";
131
131
  position: absolute;
132
132
  width: 120%;
133
133
  height: 30px;
134
- background-image: linear-gradient(45deg,
135
- var(--blog-theme-color),
136
- var(--blog-theme-color));
134
+ background-image: linear-gradient(45deg, var(--blog-theme-color), var(--blog-theme-color));
137
135
  transform: rotate(-45deg) translateY(-20px);
138
136
  display: flex;
139
137
  align-items: center;
@@ -155,10 +153,9 @@ const resultCover = computed(() => {
155
153
  cursor: pointer;
156
154
  display: flex;
157
155
  flex-direction: column;
158
-
159
- &:hover {
160
- box-shadow: var(--box-shadow-hover);
161
- }
156
+ }
157
+ .blog-item:hover {
158
+ box-shadow: var(--box-shadow-hover);
162
159
  }
163
160
 
164
161
  .info-container {
@@ -181,7 +178,6 @@ const resultCover = computed(() => {
181
178
  color: var(--description-font-color);
182
179
  font-size: 14px;
183
180
  margin-bottom: 8px;
184
- // 多行换行
185
181
  overflow: hidden;
186
182
  text-overflow: ellipsis;
187
183
  display: -webkit-box;
@@ -197,17 +193,14 @@ const resultCover = computed(() => {
197
193
  font-size: 13px;
198
194
  color: var(--badge-font-color);
199
195
  margin-top: 8px;
200
-
201
- .split:not(:last-child) {
202
- &::after {
203
- content: '';
204
- display: inline-block;
205
- width: 1px;
206
- height: 8px;
207
- margin: 0 10px;
208
- background-color: #4e5969;
209
- }
210
- }
196
+ }
197
+ .badge-list .split:not(:last-child)::after {
198
+ content: "";
199
+ display: inline-block;
200
+ width: 1px;
201
+ height: 8px;
202
+ margin: 0 10px;
203
+ background-color: #4e5969;
211
204
  }
212
205
 
213
206
  .cover-img {
@@ -235,11 +228,9 @@ const resultCover = computed(() => {
235
228
  background-size: contain;
236
229
  background-position: center;
237
230
  }
238
-
239
231
  .pc-visible {
240
232
  display: none;
241
233
  }
242
-
243
234
  .mobile-visible {
244
235
  display: block;
245
236
  }
@@ -125,20 +125,17 @@ router.onAfterRouteChange = () => {
125
125
  </ClientOnly>
126
126
  </template>
127
127
 
128
- <style lang="scss" scoped>
129
- .el-pagination-wrapper {
130
- :deep(.sugar-pagination li.is-active.number) {
131
- background-color: var(--vp-c-brand-2);
132
- }
133
- :deep(.sugar-pagination button:hover) {
134
- color: var(--vp-c-brand-2);
135
- }
136
-
137
- :deep(.sugar-pager li:not(.is-active):hover) {
138
- color: var(--vp-c-brand-2);
139
- }
140
- :deep(.sugar-input__wrapper:focus-within) {
141
- box-shadow: 0 0 0 1px var(--vp-c-brand-2) inset;
142
- }
128
+ <style scoped>
129
+ .el-pagination-wrapper :deep(.sugar-pagination li.is-active.number) {
130
+ background-color: var(--vp-c-brand-2);
131
+ }
132
+ .el-pagination-wrapper :deep(.sugar-pagination button:hover) {
133
+ color: var(--vp-c-brand-2);
134
+ }
135
+ .el-pagination-wrapper :deep(.sugar-pager li:not(.is-active):hover) {
136
+ color: var(--vp-c-brand-2);
137
+ }
138
+ .el-pagination-wrapper :deep(.sugar-input__wrapper:focus-within) {
139
+ box-shadow: 0 0 0 1px var(--vp-c-brand-2) inset;
143
140
  }
144
141
  </style>
@@ -206,7 +206,7 @@ function handleLinkClick(link: string) {
206
206
  </div>
207
207
  </template>
208
208
 
209
- <style lang="scss" scoped>
209
+ <style scoped>
210
210
  .card {
211
211
  position: relative;
212
212
  margin: 0 auto 10px;
@@ -219,17 +219,17 @@ function handleLinkClick(link: string) {
219
219
  transition: all 0.3s;
220
220
  background-color: rgba(var(--bg-gradient));
221
221
  display: flex;
222
-
223
- &:hover {
224
- box-shadow: var(--box-shadow-hover);
225
- }
222
+ }
223
+ .card:hover {
224
+ box-shadow: var(--box-shadow-hover);
226
225
  }
227
226
 
228
227
  .recommend {
229
228
  flex-direction: column;
230
229
  padding: 0px;
231
230
  }
232
- .recommend.card{
231
+
232
+ .recommend.card {
233
233
  padding: 10px;
234
234
  }
235
235
 
@@ -240,63 +240,48 @@ function handleLinkClick(link: string) {
240
240
  margin: 0;
241
241
  padding: 0 10px 0 0px;
242
242
  width: 100%;
243
-
244
- &.hide-num>li{
245
- padding: 5px 0;
246
- }
247
- li {
248
- display: flex;
249
-
250
- .num {
251
- display: block;
252
- font-size: 14px;
253
- color: var(--description-font-color);
254
- font-weight: 600;
255
- margin: 6px 8px 10px 0;
256
- width: 22px;
257
- height: 18px;
258
- line-height: 18px;
259
- text-align: center;
260
- }
261
-
262
- .des {
263
- overflow: hidden;
264
- text-overflow: ellipsis;
265
- white-space: nowrap;
266
- display: flex;
267
- flex-direction: column;
268
- justify-content: center;
269
- }
270
-
271
- .title {
272
- font-size: 14px;
273
- color: var(--vp-c-text-1);
274
- word-break: break-all;
275
- white-space: break-spaces;
276
- font-weight: 500;
277
- position: relative;
278
- cursor: pointer;
279
- transition: color .25s;
280
- &.current,&:hover {
281
- color: var(--vp-c-brand-1);
282
- }
283
- }
284
-
285
- // .title:hover::after {
286
- // content: "";
287
- // position: absolute;
288
- // left: 0;
289
- // right: 0;
290
- // height: 0;
291
- // bottom: -3px;
292
- // border-bottom: 1px solid #b1b3b8;
293
- // }
294
-
295
- .suffix {
296
- font-size: 12px;
297
- color: var(--vp-c-text-2);
298
- }
299
- }
243
+ }
244
+ .recommend-container.hide-num > li {
245
+ padding: 5px 0;
246
+ }
247
+ .recommend-container li {
248
+ display: flex;
249
+ }
250
+ .recommend-container li .num {
251
+ display: block;
252
+ font-size: 14px;
253
+ color: var(--description-font-color);
254
+ font-weight: 600;
255
+ margin: 6px 8px 10px 0;
256
+ width: 22px;
257
+ height: 18px;
258
+ line-height: 18px;
259
+ text-align: center;
260
+ }
261
+ .recommend-container li .des {
262
+ overflow: hidden;
263
+ text-overflow: ellipsis;
264
+ white-space: nowrap;
265
+ display: flex;
266
+ flex-direction: column;
267
+ justify-content: center;
268
+ }
269
+ .recommend-container li .title {
270
+ font-size: 14px;
271
+ color: var(--vp-c-text-1);
272
+ word-break: break-all;
273
+ white-space: break-spaces;
274
+ font-weight: 500;
275
+ position: relative;
276
+ cursor: pointer;
277
+ transition: color 0.25s;
278
+ }
279
+ .recommend-container li .title.current, .recommend-container li .title:hover {
280
+ color: var(--vp-c-brand-1);
281
+ }
282
+ .recommend-container li .suffix {
283
+ font-size: 12px;
284
+ color: var(--vp-c-text-2);
300
285
  }
301
286
 
302
287
  .card-header {
@@ -305,12 +290,11 @@ function handleLinkClick(link: string) {
305
290
  justify-content: space-between;
306
291
  align-items: center;
307
292
  margin-bottom: 10px;
308
-
309
- .title {
310
- font-size: 14px;
311
- display: flex;
312
- align-items: center;
313
- }
293
+ }
294
+ .card-header .title {
295
+ font-size: 14px;
296
+ display: flex;
297
+ align-items: center;
314
298
  }
315
299
 
316
300
  .empty-text {
@@ -16,7 +16,7 @@ const sidebarStyle = computed(() =>
16
16
  </div>
17
17
  </template>
18
18
 
19
- <style lang="scss" scoped>
19
+ <style scoped>
20
20
  .sidebar.card {
21
21
  margin-top: 40px;
22
22
  }
@@ -54,7 +54,7 @@ const classes = computed(() => {
54
54
  </button>
55
55
  </template>
56
56
 
57
- <style lang="scss" scoped>
57
+ <style scoped>
58
58
  .sugar-button {
59
59
  display: inline-flex;
60
60
  justify-content: center;
@@ -67,7 +67,7 @@ const classes = computed(() => {
67
67
  text-align: center;
68
68
  box-sizing: border-box;
69
69
  outline: none;
70
- transition: .1s;
70
+ transition: 0.1s;
71
71
  font-weight: 500;
72
72
  user-select: none;
73
73
  vertical-align: middle;
@@ -77,89 +77,74 @@ const classes = computed(() => {
77
77
  border-radius: 4px;
78
78
  padding: 8px 15px;
79
79
  font-size: 14px;
80
-
81
- &:hover {
82
- color: var(--vp-c-brand-1);
83
- border-color: var(--vp-c-brand-2);
84
- background-color: var(--vp-c-bg-alt);
85
- }
86
-
87
- &:active {
88
- color: var(--vp-c-brand-3);
89
- border-color: var(--vp-c-brand-3);
90
- }
91
-
92
- &.is-disabled {
93
- cursor: not-allowed;
94
- opacity: 0.5;
95
- }
96
-
97
80
  /* Types */
98
- &--primary {
99
- color: #fff;
100
- background-color: var(--vp-c-brand-1);
101
- border-color: var(--vp-c-brand-1);
102
-
103
- &:hover {
104
- background-color: var(--vp-c-brand-2);
105
- border-color: var(--vp-c-brand-2);
106
- color: #fff;
107
- }
108
-
109
- &:active {
110
- background-color: var(--vp-c-brand-3);
111
- border-color: var(--vp-c-brand-3);
112
- color: #fff;
113
- }
114
-
115
- &.is-text {
116
- color: var(--vp-c-brand-1);
117
- background-color: transparent;
118
- border-color: transparent;
119
-
120
- &:hover {
121
- background-color: var(--vp-c-bg-alt);
122
- color: var(--vp-c-brand-2);
123
- }
124
-
125
- &:active {
126
- color: var(--vp-c-brand-3);
127
- }
128
- }
129
- }
130
-
131
- &--danger {
132
- color: #fff;
133
- background-color: var(--vp-c-danger-2);
134
- border-color: var(--vp-c-danger-2);
135
-
136
- &:hover {
137
- background-color: var(--vp-c-danger-3);
138
- border-color: var(--vp-c-danger-3);
139
- color: #fff;
140
- }
141
-
142
- &:active {
143
- background-color: var(--vp-c-danger-3);
144
- border-color: var(--vp-c-danger-3);
145
- color: #fff;
146
- }
147
- }
148
-
149
- // 其它有需要再引入
150
81
  /* Sizes */
151
- &--small {
152
- height: 24px;
153
- padding: 5px 11px;
154
- font-size: 12px;
155
- border-radius: 3px;
156
- }
157
-
158
- &--large {
159
- height: 40px;
160
- padding: 12px 19px;
161
- font-size: 16px;
162
- border-radius: 4px;
163
- }
82
+ }
83
+ .sugar-button:hover {
84
+ color: var(--vp-c-brand-1);
85
+ border-color: var(--vp-c-brand-2);
86
+ background-color: var(--vp-c-bg-alt);
87
+ }
88
+ .sugar-button:active {
89
+ color: var(--vp-c-brand-3);
90
+ border-color: var(--vp-c-brand-3);
91
+ }
92
+ .sugar-button.is-disabled {
93
+ cursor: not-allowed;
94
+ opacity: 0.5;
95
+ }
96
+ .sugar-button--primary {
97
+ color: #fff;
98
+ background-color: var(--vp-c-brand-1);
99
+ border-color: var(--vp-c-brand-1);
100
+ }
101
+ .sugar-button--primary:hover {
102
+ background-color: var(--vp-c-brand-2);
103
+ border-color: var(--vp-c-brand-2);
104
+ color: #fff;
105
+ }
106
+ .sugar-button--primary:active {
107
+ background-color: var(--vp-c-brand-3);
108
+ border-color: var(--vp-c-brand-3);
109
+ color: #fff;
110
+ }
111
+ .sugar-button--primary.is-text {
112
+ color: var(--vp-c-brand-1);
113
+ background-color: transparent;
114
+ border-color: transparent;
115
+ }
116
+ .sugar-button--primary.is-text:hover {
117
+ background-color: var(--vp-c-bg-alt);
118
+ color: var(--vp-c-brand-2);
119
+ }
120
+ .sugar-button--primary.is-text:active {
121
+ color: var(--vp-c-brand-3);
122
+ }
123
+ .sugar-button--danger {
124
+ color: #fff;
125
+ background-color: var(--vp-c-danger-2);
126
+ border-color: var(--vp-c-danger-2);
127
+ }
128
+ .sugar-button--danger:hover {
129
+ background-color: var(--vp-c-danger-3);
130
+ border-color: var(--vp-c-danger-3);
131
+ color: #fff;
132
+ }
133
+ .sugar-button--danger:active {
134
+ background-color: var(--vp-c-danger-3);
135
+ border-color: var(--vp-c-danger-3);
136
+ color: #fff;
137
+ }
138
+ .sugar-button--small {
139
+ height: 24px;
140
+ padding: 5px 11px;
141
+ font-size: 12px;
142
+ border-radius: 3px;
143
+ }
144
+ .sugar-button--large {
145
+ height: 40px;
146
+ padding: 12px 19px;
147
+ font-size: 16px;
148
+ border-radius: 4px;
164
149
  }
165
150
  </style>