1.4.0 • Published 7 years ago

stylerjs v1.4.0

Weekly downloads
89
License
ISC
Repository
github
Last release
7 years ago

This is a simple JavaScript function which allows you to get and set CSS properties on DOM elements with ease.

npm install stylerjs

Usage

var styler = require('stylerjs')

Now that stylerjs has been imported in to your project you're able to start getting and setting CSS properties to your DOM elements.

Get Styles

var styles = styler('.class-name').get(['height', 'width']);

or you can pass it a node

var element = document.querySelector('.class-name');
var styles = styler(element).get(['height', 'width']);

Set Styles

You can set styles to multiple DOM elements by passing it a class. This will apply all of your specified styles to those elements.

styler('.class-name').set({ 'height': '50px', 'width': '50px' });

or you can pass the styler a single node if you wish to do just one.

var element = document.querySelector('.class-name');
styler(element).set({ 'height': '50px', 'width': '50px' });
1.4.0

7 years ago

1.3.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago