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.
- Host: GitHub
- URL: https://github.com/up9cloud/css.js
- Owner: up9cloud
- License: mit
- Created: 2014-08-11T13:07:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-31T11:51:22.000Z (almost 12 years ago)
- Last Synced: 2025-03-22T21:20:21.254Z (about 1 year ago)
- Language: JavaScript
- Size: 223 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/