1.0.3 • Published 7 years ago

get-default-style.js v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

getDefaultStyle

An API which is able to get default computed value(except for width / height) in state of non specified style via dummy ifame in the browser.

Installation

bower install get-default-style.js

or

yarn add get-default-style.js

Load with script tag

<script src="/path/to/get-default-style.js">

Usage

Almost the same as getComputedStyle

let style = getDefaultStyle(element[, pseudoElt]);

API

getPropertyValue

style.getPropertyValue(propertyName);//any value

Example

let div = document.querySelector('div');
let style = getDefaultStyle(div);
style.getPropertyValue('width');//auto
style.getPropertyValue('margin-top');//0px
style.getPropertyValue('background-position');//0% 0%
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago