# computed-styles

> Get the computed styles of a DOM element in a cross browser consistent manner

Latest version **1.1.2** (published 2015-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install computed-styles
pnpm add computed-styles
yarn add computed-styles
bun add computed-styles
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2015-10-28 |
| First published | 2015-10-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | J. Harshbarger |
| Maintainers | hypercubed |
| Keywords | browser, css, getComputedStyles, dom |

## Links

- npm: https://www.npmjs.com/package/computed-styles
- Repository: https://github.com/Hypercubed/computed-styles
- Homepage: https://github.com/Hypercubed/computed-styles#readme
- Issues: https://github.com/Hypercubed/computed-styles/issues
- npm.io page: https://npm.io/package/computed-styles

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2015-10-28
- 1.1.1 — 2015-10-27
- 1.1.0 — 2015-10-27
- 1.0.4 — 2015-10-19
- 1.0.3 — 2015-10-16
- 1.0.2 — 2015-10-15
- 1.0.0 — 2015-10-15

## README

# computed-style

[![NPM version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Downloads][download-badge]][npm-url]

> Get the computed styles of a DOM element in a cross browser consistent manner

## Install

```sh
npm install computed-styles
```

## Usage

### Get computed styles

```js
import computedStyles from 'computed-styles';

computedStyles(document.querySelector('#node')) // returns computed styles as an object
```

### Convert computed styles to inline styles

```js
import computedStyles from 'computed-styles';

var node = document.querySelector('#node');
computedStyles(node, node.styles);
```

### Copy computed styles to another element

```js
import computedStyles from 'computed-styles';

var source = document.querySelector('#source');
var target = document.querySelector('#target');
computedStyles(source, target.styles);
```

See [API](API.md)

## License

MIT © [J. Harshbarger](http://github.com/Hypercubed)

[npm-url]: https://npmjs.org/package/computed-styles
[npm-image]: https://img.shields.io/npm/v/computed-styles.svg?style=flat-square

[travis-url]: https://travis-ci.org/Hypercubed/computed-styles
[travis-image]: https://img.shields.io/travis/Hypercubed/computed-styles.svg?style=flat-square

[download-badge]: http://img.shields.io/npm/dm/computed-styles.svg?style=flat-square

---
_Source: https://npm.io/package/computed-styles · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
