3 Star 54 Fork 14

Yaohaixiao / dom.js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
getProperty.js 533 Bytes
一键复制 编辑 原始数据 按行查看 历史
/**
* 获取 CSS 变量(属性)值。返回一个 DOMString ,其中包含请求的 CSS 属性的值。
* ========================================================================
* @method getPropperty
* @see https://developer.mozilla.org/zh-CN/docs/Web/API/CSSStyleDeclaration/getPropertyValue
* @param {String} prop
* @return {String}
*/
const getProperty = (prop) => {
const documentElement = document.documentElement
return documentElement.style.getPropertyValue(prop)
}
export default getProperty
JavaScript
1
https://gitee.com/yaohaixiao/dom.js.git
git@gitee.com:yaohaixiao/dom.js.git
yaohaixiao
dom.js
dom.js
main

搜索帮助