Skip to content

niksy/load-style-p

Repository files navigation

load-style-p

Build Status BrowserStack Status

Load style as promise.

Install

npm install load-style-p --save

Usage

import loadStyle from 'load-style-p';

loadStyle('http://example.com/jackie.css')
	.then(()=> {
		// ...
	});

API

loadStyle(src)

Returns: Promise

Loads stylesheet from URL.

src

Type: String

Stylesheet URL.

Browser support

Tested in IE9+ and all modern browsers. Promise should be available globally.

Test

For automated tests, run npm run test:automated (append :watch for watcher support).

License

MIT © Ivan Nikolić

About

Load style as promise.

Resources

License

Stars

Watchers

Forks

Packages

No packages published