dom-class-styles

Get the styles properties of a CSS class

Usage no npm install needed!

<script type="module">
  import domClassStyles from 'https://cdn.skypack.dev/dom-class-styles';
</script>

README

dom-class-styles

Install

npm install --save dom-class-styles

Example

var classStyles = require('dom-class-styles');
var styles = classStyles('class-name');
console.log(styles.border);

About

Get the styles of a class from a style sheet in the current HTML document. If there is more than one CSS document in the page the furthest one down in the HTML will be used.