reference/scripts/nodes/htmlTagAddAttri.mjs

9 lines
241 B
JavaScript
Raw Normal View History

2022-09-27 23:09:51 +08:00
export function htmlTagAddAttri(node, { isHome }) {
2022-09-26 17:13:24 +08:00
if (node && node.tagName === 'html') {
node.properties['data-color-mode'] = 'dark';
}
2022-09-27 23:09:51 +08:00
if (node && node.tagName === 'body' && isHome) {
node.properties.class = ['home'];
}
2022-10-29 00:24:39 +08:00
}