Skip to content

Commit 0dac26a

Browse files
committed
release: v2.1.2
2 parents 02d5a2e + caece89 commit 0dac26a

27 files changed

Lines changed: 358 additions & 158 deletions

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
## 更新日志
22

3+
### 2.1.2
4+
5+
*2024-07-10*
6+
7+
#### Docs 📝
8+
9+
- 暗黑开关新增键盘`enter`切换
10+
- 新增外部链接图标和自适应效果
11+
12+
#### Fix 🐛
13+
14+
- 断点隐藏类媒体查询范围异常
15+
316
### 2.1.1
417

518
*2024-07-02*
@@ -45,6 +58,14 @@
4558

4659
- 修复`red`颜色提取异常问题
4760

61+
### 1.0.3
62+
63+
*2024-04-25*
64+
65+
#### Docs 📝
66+
67+
- 新增使用示例
68+
4869
### 1.0.2
4970

5071
*2023-07-05*

README.en.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<h1 style="color: #409eff; text-align: center; font-size: 50px">Element-theme-darkplus</h1>
1+
<h1 align="center">Element-theme-darkplus</h1>
22

3-
<p style='text-align: center'>
3+
<p align="center">
44
<a href="https://github.com/ElemeFE/element">
55
<img src="https://img.shields.io/badge/element--ui-2.15.14-blue.svg" alt="element-ui" />
66
</a>
@@ -36,7 +36,7 @@ npm i element-theme-darkplus -S
3636
## Import
3737

3838
```javascript
39-
// webpack
39+
// Webpack
4040
import 'element-theme-darkplus/lib/index.css';
4141

4242
// CDN
@@ -46,6 +46,7 @@ import 'element-theme-darkplus/lib/index.css';
4646
## Import on demand
4747

4848
```javascript
49+
// Webpack
4950
import 'element-theme-darkplus/lib/input.css';
5051

5152
// CDN
@@ -54,7 +55,7 @@ import 'element-theme-darkplus/lib/input.css';
5455

5556
## Switch
5657

57-
If you have a chalk theme, a dark theme, two themes free to switch, then this way is best for you.
58+
If you have a chalk theme, a dark theme, two themes free to switch, then the following is best for you.
5859

5960
```javascript
6061
import 'element-ui/lib/theme-chalk/index.css';
@@ -97,9 +98,9 @@ The progress bar component [Progress](https://github.com/ElemeFE/element/blob/ma
9798

9899
Although the two components can pass null values to reset properties to support dark themes, for students who are not concerned about this feature, it is unclear why properties such as `text-color=""` are passed in, which undoubtedly adds mental burden at the development level.
99100

100-
The style approach cannot solve the fundamental problem of `Rate` and `Progress`.
101+
Um The style cannot solve the fundamental problem of `Rate` and `Progress`.
101102

102-
We have considered another approach, which is to redefine the `Rate` and `Progress` components, but without compromising the scalability and uniqueness of the original components. Therefore, we adopted the method of inheriting the original components and added an intermediate layer in `javascript` to help users initially empty the relevant color `props`.
103+
Can you redefine the `Rate` and `Progress` components? Without breaking the extensibility and uniqueness of the original component, adopted the method of inheriting the original component and make a middle layer in `javascript` to help the user initially empty the related colors `props`.
103104

104105
### Import
105106

@@ -131,7 +132,7 @@ Vue.component(Rate.name, Darken(Rate))
131132

132133
### How to persist themes, update themes responsive to the system?
133134

134-
The theme `switch` in [The preview page](https://dongwei1125.github.io/theme-dark) has added common dark theme functions, such as browser caching to permanently save the user's frequently used theme status, dynamically switching theme styles according to operating system presets, and media query style transition. You can refer to the component [ThemeToggle](https://github.com/dongwei1125/theme-dark/tree/master/docs/components/ThemeToggle/dark).
135+
The theme `switch` in [The preview page](https://dongwei1125.github.io/theme-dark) has added common dark theme functions, such as browser caching to permanently save the user's frequently used theme status, dynamically switching theme styles according to operating system presets, and media query style transition. You can refer to the component [ThemeToggle](https://github.com/dongwei1125/theme-dark/tree/master/docs/components/ThemeToggle/dark) or [Sample](https://codepen.io/dongwei1125/pen/dyExzaP).
135136

136137
### Persistent loading for the first time in dark mode with white screen?
137138

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<h1 style="color: #409eff; text-align: center; font-size: 50px">Element-theme-darkplus</h1>
1+
<h1 align="center">Element-theme-darkplus</h1>
22

3-
<p style='text-align: center'>
3+
<p align="center">
44
<a href="https://github.com/ElemeFE/element">
55
<img src="https://img.shields.io/badge/element--ui-2.15.14-blue.svg" alt="element-ui" />
66
</a>
@@ -36,7 +36,7 @@ npm i element-theme-darkplus -S
3636
## 引入
3737

3838
```javascript
39-
// webpack
39+
// Webpack
4040
import 'element-theme-darkplus/lib/index.css';
4141

4242
// CDN
@@ -46,6 +46,7 @@ import 'element-theme-darkplus/lib/index.css';
4646
## 部分引入
4747

4848
```javascript
49+
// Webpack
4950
import 'element-theme-darkplus/lib/input.css';
5051

5152
// CDN
@@ -54,7 +55,7 @@ import 'element-theme-darkplus/lib/input.css';
5455

5556
## 切换式
5657

57-
如果你准备了一套白垩主题,一套暗黑主题,两种主题自由切换,那么此方式最适合你
58+
如果你准备了一套白垩主题,一套暗黑主题,两种主题自由切换,那么以下最适合你
5859

5960
```javascript
6061
import 'element-ui/lib/theme-chalk/index.css';
@@ -70,15 +71,15 @@ import `element-theme-darkplus/lib/input.color.css`;
7071

7172
## 高级
7273

73-
评分组件 [Rate](https://github.com/ElemeFE/element/blob/master/packages/rate/src/main.vue) 较为特殊,`Element`内部与颜色相关的`props`均定义了默认值,且`template`模板中都采用内联样式,导致外部主题样式无法覆盖。
74+
评分组件 [Rate](https://github.com/ElemeFE/element/blob/master/packages/rate/src/main.vue) 较为特殊,`Element`内部与颜色相关`props`均定义了默认值,且`template`模板中都采用内联样式,导致外部主题样式无法覆盖。
7475

7576
| `Props` | `默认值` |
7677
| --- | --- |
7778
| `void-color` | `#c6d1de` |
7879
| `disabled-void-color` | `#eff2f7` |
7980
| `text-color` | `#1f2d3d` |
8081

81-
可传空值重置相应的`props`值使主题生效。
82+
可传空值重置相应`props`值使主题生效。
8283

8384
```html
8485
<el-rate :value="3" show-text void-color="" text-color="" />
@@ -97,9 +98,9 @@ import `element-theme-darkplus/lib/input.color.css`;
9798

9899
虽然两组件可以传空值重置属性以支持暗黑主题,而对于不关心此功能的同学,却不清楚为什么会传入诸如`text-color=""`这样的属性,这无疑在开发层面徒增了心智负担。
99100

100-
样式方式是无法解决`Rate``Progress`根本性问题
101+
`...`样式么法解决`Rate``Progress`根本性问题了
101102

102-
我们考虑了另外一种方式,即重新定义`Rate``Progress`组件,但又不能破坏原组件的拓展性和唯一性,所以我们采用继承原始组件的方式,在`javascript`里做了一个中间层,帮助用户初始置空相关颜色`props`
103+
重新定义`Rate``Progress`组件可以吗?还不能破坏原组件的拓展性和唯一性,则采用继承原始组件并在`javascript`里做了一个中间层,帮助用户初始置空相关颜色`props`
103104

104105
### 全量引入
105106

@@ -131,7 +132,7 @@ Vue.component(Rate.name, Darken(Rate))
131132

132133
### 如何持久化主题、跟随系统响应式更新主题等?
133134

134-
[预览页](https://dongwei1125.github.io/theme-dark) 中主题切换开关`switch`添加了常见的暗黑主题功能,例如浏览器缓存永久保存用户常用主题状态、跟随操作系统预设动态切换主题风格、媒体查询式主题风格过渡等,可参考组件 [ThemeToggle](https://github.com/dongwei1125/theme-dark/tree/master/docs/components/ThemeToggle/dark)
135+
[预览页](https://dongwei1125.github.io/theme-dark) 中主题切换开关`switch`添加了常见的暗黑主题功能,例如浏览器缓存永久保存用户常用主题状态、跟随操作系统预设动态切换主题风格、媒体查询式主题风格过渡等,可参考组件 [ThemeToggle](https://github.com/dongwei1125/theme-dark/tree/master/docs/components/ThemeToggle/dark)[示例](https://codepen.io/dongwei1125/pen/dyExzaP)
135136

136137
### 持久化首次载入暗黑模式白屏?
137138

docs/App.vue

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
<template>
22
<div class="app">
33
<div class="navbar">
4-
<h1>Element-theme-darkplus</h1>
4+
<a href="">
5+
<h1>Element-theme-darkplus</h1>
6+
</a>
57

68
<div>
7-
<header-search />
8-
<theme-toggle />
9-
<git-hub />
10-
<gitee />
11-
<npm />
9+
<fuse-search class="hidden-xxs hidden-xs hidden-sm hidden-md" />
10+
<theme-toggle class="hidden-xxs" />
11+
<git-hub class="hidden-xxs hidden-xs hidden-sm hidden-lg hidden-xl" />
12+
<gitee class="hidden-xxs hidden-xs hidden-sm hidden-lg hidden-xl" />
13+
<npm class="hidden-xxs hidden-xs hidden-sm hidden-lg hidden-xl" />
14+
<link-dropdown class="hidden-xxs hidden-xs hidden-md hidden-lg hidden-xxl" />
1215
</div>
1316
</div>
1417

@@ -73,11 +76,12 @@
7376
</template>
7477

7578
<script>
76-
import HeaderSearch from './components/HeaderSearch.vue'
79+
import FuseSearch from './components/FuseSearch.vue'
7780
import ThemeToggle from './components/ThemeToggle/index.vue'
7881
import GitHub from './components/GitHub.vue'
7982
import Gitee from './components/Gitee.vue'
8083
import Npm from './components/Npm.vue'
84+
import LinkDropdown from './components/LinkDropdown.vue'
8185
8286
import AlertExample from './examples/Alert.vue'
8387
import AutocompleteExample from './examples/Autocomplete.vue'
@@ -138,11 +142,12 @@ import UploadExample from './examples/Upload.vue'
138142
export default {
139143
name: 'App',
140144
components: {
141-
HeaderSearch,
145+
FuseSearch,
146+
ThemeToggle,
142147
GitHub,
143148
Gitee,
144149
Npm,
145-
ThemeToggle,
150+
LinkDropdown,
146151
AlertExample,
147152
AutocompleteExample,
148153
AvatarExample,
@@ -227,27 +232,33 @@ html.dark .navbar {
227232
background-image: radial-gradient(transparent 1px, #141414 1px);
228233
}
229234
235+
.navbar > a {
236+
text-decoration: none;
237+
}
238+
230239
.navbar h1 {
231240
margin: 0;
232241
color: #409eff;
233242
font-size: 24px;
234-
font-weight: 500;
235-
font-family: 'Segoe UI';
236243
}
237244
238245
.navbar > div {
239246
display: flex;
240247
align-items: center;
241248
}
242249
250+
.navbar .fuse-search {
251+
margin: 0 12px;
252+
}
253+
243254
.navbar .theme-toggle {
244-
padding: 0 12px;
255+
margin: 0 12px;
245256
}
246257
247-
.navbar a {
258+
.navbar div a {
248259
display: inline-block;
249260
height: 100%;
250-
padding: 0 12px;
261+
margin: 0 12px;
251262
font-size: 15px;
252263
font-weight: bold;
253264
color: currentColor;
@@ -272,3 +283,57 @@ html.dark .content >>> h2 {
272283
color: #cfd3dc;
273284
}
274285
</style>
286+
287+
<style scoped>
288+
/*
289+
xxs <439
290+
xs ≥439
291+
sm ≥459
292+
md ≥580
293+
lg ≥673
294+
xl ≥693
295+
xxl ≥814
296+
*/
297+
298+
@media (max-width: 438px) {
299+
.hidden-xxs {
300+
display: none !important;
301+
}
302+
}
303+
304+
@media (min-width: 439px) and (max-width: 458px) {
305+
.hidden-xs {
306+
display: none !important;
307+
}
308+
}
309+
310+
@media (min-width: 459px) and (max-width: 579px) {
311+
.hidden-sm {
312+
display: none !important;
313+
}
314+
}
315+
316+
@media (min-width: 580px) and (max-width: 672px) {
317+
.hidden-md {
318+
display: none !important;
319+
}
320+
}
321+
322+
@media (min-width: 673px) and (max-width: 692px) {
323+
.hidden-lg {
324+
display: none !important;
325+
}
326+
}
327+
328+
@media (min-width: 693px) and (max-width: 813px) {
329+
.hidden-xl {
330+
display: none !important;
331+
}
332+
}
333+
334+
@media (min-width: 814px) {
335+
.hidden-xxl {
336+
display: none !important;
337+
}
338+
}
339+
</style>

0 commit comments

Comments
 (0)