Files
.github
.husky
docs
scripts
assets
nodes
footer.mjs
header.mjs
htmlTagAddAttri.mjs
logo.mjs
style
utils
build.mjs
create.mjs
index.mjs
watch.mjs
.dockerignore
.editorconfig
.gitattributes
.gitignore
.lintstagedrc
.markdownlint.json
.prettierignore
.prettierrc
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
package.json
renovate.json
reference/scripts/nodes/htmlTagAddAttri.mjs
2022-10-29 00:24:39 +08:00

9 lines
241 B
JavaScript

export function htmlTagAddAttri(node, { isHome }) {
if (node && node.tagName === 'html') {
node.properties['data-color-mode'] = 'dark';
}
if (node && node.tagName === 'body' && isHome) {
node.properties.class = ['home'];
}
}