An open API service indexing awesome lists of open source software.

https://github.com/up9cloud/css.js

load or remove css. For change website theme.
https://github.com/up9cloud/css.js

Last synced: 2 months ago
JSON representation

load or remove css. For change website theme.

Awesome Lists containing this project

README

          

$css.js
======

Create or remove css link node.

Influenced by [$script]

#[Live demo][demo]

#Download

```sh
wget 'https://raw.githubusercontent.com/up9cloud/css.js/master/dist/$css.min.js'
```

#Usage

Create a css link.
```js
$css('bootstrap.css')
//
```

Create css links more than one.
```js
$css(['bootstrap.css', 'another-bootstrap.css'])
//
//
```

Remove the links have href=?
```js
$css.remove(['bootstrap.css', 'another-bootstrap.css'])
```

Callback
```js
$css('bootstrap.css',function(){
//do something after css loaded.
})
```

#Development

- install [nodejs] and npm first.
```
clone https://github.com/up9cloud/css.js.git
cd css.js && npm install
```

- watch file
```
grunt dev
```

##Test
```
karma start
```

##Different browsers?

[To ensure css link is loaded][when css loaded]

[demo]:htts://demo.up9cloud.net/css.js/
[$script]:https://github.com/ded/script.js
[when css loaded]:http://www.phpied.com/when-is-a-stylesheet-really-loaded/
[nodejs]:http://nodejs.org/