Skip to content

Commit

Permalink
chore: 更新 README
Browse files Browse the repository at this point in the history
  • Loading branch information
Sight-wcg committed Jun 3, 2023
1 parent 5f628f3 commit c0ee8a5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ layui 暗色主题

#### 方式一

通过[示例](https://sight-wcg.github.io/layui-theme-dark/)中的主题面板,自定义主题类名,例如 `.dark`,通过改变 HTML 标签的类名切换主题
通过[演示](https://sight-wcg.github.io/layui-theme-dark/)中的主题面板,自定义主题类选择器,例如 `.dark`,通过改变 HTML 标签的类名切换主题

```css
/** CSS 生成 */
Expand All @@ -31,7 +31,7 @@ document.documentElement.classList.toggle('dark')
```
#### 方式二

通过[示例](https://sight-wcg.github.io/layui-theme-dark/)中的主题面板,自定义主题属性名,例如`[theme-mode='dark']`,通过改变 HTML 标签上 `theme-mode` 属性的值切换主题
通过[演示](https://sight-wcg.github.io/layui-theme-dark/)中的主题面板,自定义主题属性选择器,例如`[theme-mode='dark']`,通过改变 HTML 标签上 `theme-mode` 属性的值切换主题

```css
/** CSS 生成 */
Expand Down Expand Up @@ -66,6 +66,13 @@ document.documentElement.removeAttribute('theme-mode')
// 恢复亮色主题
document.getElementById('#layui_theme_css').removeAttribute('href')
```
# 第三方模块

对一些高质量且使用广泛的第三方模块行了支持,存放在 ext 目录,默认不会集成
- layui-soul-table
- xm-select

# ColorMode 模块(WIP)

# IE9+

Expand Down
4 changes: 2 additions & 2 deletions docs/tpl/theme.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<input name="colorpicker" type="checkbox" style="height: 20px; width: 20px;">
</label>
<label title="类名/属性名例如 .dark,[theme-mode='dark']">
自定义主题类名/属性名
自定义主题类/属性选择器
<input name="theme-prefix" type="input" style="height: 18px; width: 150px;">
</label>
<i id="theme-prefix-tips" class="layui-icon layui-icon-tips" style="position: relative; top: 3.5px;margin-left: 2px;"></i>
Expand Down Expand Up @@ -217,7 +217,7 @@
? `${hasPrefix}{${overrideCSS}}`
: overrideCSS}`;

/** css-next 插件太大,暂时用 less */
// css-next 插件太大,暂时用 less
finalCSS = (await window.less.render(finalCSS)).css
const alink=document.createElement("a")
alink.download='layui-theme-dark-custom.css'
Expand Down

0 comments on commit c0ee8a5

Please sign in to comment.