https://github.com/yefremov/loadcss
Fast and reliable utility to asynchronously load multiple css files
https://github.com/yefremov/loadcss
css loadcss preload stylesheets
Last synced: 8 months ago
JSON representation
Fast and reliable utility to asynchronously load multiple css files
- Host: GitHub
- URL: https://github.com/yefremov/loadcss
- Owner: yefremov
- License: mit
- Created: 2017-02-18T03:33:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-29T19:28:46.000Z (about 9 years ago)
- Last Synced: 2025-08-17T12:39:51.935Z (10 months ago)
- Topics: css, loadcss, preload, stylesheets
- Language: JavaScript
- Homepage:
- Size: 11.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# loadcss [](https://travis-ci.org/yefremov/loadcss) [](https://badge.fury.io/js/loadcss)
Fast and reliable utility to asynchronously load multiple css files and apply to
the document.
## Installation
```bash
$ npm install loadcss
```
## API
```js
import loadcss from 'loadcss';
// load a single css file
loadcss('/foo.css', links => {
links.forEach(link => console.log(link.href));
});
// load multiple css files
loadcss(['/a/foo.css', '/b/bar.css'], links => {
links.forEach(link => console.log(link.href));
});
```
## Running tests
```bash
$ npm test
```
## License
[MIT](LICENSE)