Skip to content

Commit

Permalink
release v1.1.3 | bugfix: darkmode className should not be added when …
Browse files Browse the repository at this point in the history
…forcing lightmode
  • Loading branch information
JaminQ committed Oct 17, 2023
1 parent e5fbede commit 6b6ee86
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/darkmode.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/darkmode.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mp-darkmode",
"version": "1.1.2",
"version": "1.1.3",
"description": "微信公众平台图文 Dark Mode 转换算法",
"main": "dist/darkmode.min.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/darkmode.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export function init(opt = {}) {

if (['dark', 'light'].indexOf(opt.mode) > -1) {
config.set('string', opt, 'mode');
document.getElementsByTagName('html')[0].classList.add(HTML_CLASS);
opt.mode === 'dark' && document.getElementsByTagName('html')[0].classList.add(HTML_CLASS);
}

config.set('function', opt, 'begin');
Expand Down
2 changes: 1 addition & 1 deletion test/darkmode_online.js

Large diffs are not rendered by default.

0 comments on commit 6b6ee86

Please sign in to comment.