跳到主要内容

设置 html 元素节点行内样式

versionNPM Last UpdateMonthly downloadsTotal downloads

源码参看bug 🙋‍♂️ 提交

简单的为 html 的元素节点设置行内样式。

安装

npm install  a-element-inline-style --save

使用

使用

设置行内样式

import { setStyle } from 'a-element-inline-style';

setStyle(document.body, {
width: '100%',
'--custom-width': '80%',
});

移除行内样式

import { removeStyle } from 'a-element-inline-style';

removeStyle(document.body, ['width', '--custom-width']);

属性命名请使用小驼峰