Skip to content

Commit 04571b8

Browse files
committed
Merge pull request tobiasahlin#70 from jmagnusson/scss-readme-updates
Update readme to reflect SCSS and gulp additions
2 parents e654763 + e7b3de1 commit 04571b8

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ SpinKit uses CSS animations to create smooth and easily customizable animations.
88

99
Grab the HTML and CSS for a spinner and include it in your project. Note that a hidden spinner (`opacity: 0`, or `visibility: hidden`) will still animate. After hiding a spinner, it's recommended to remove it from the DOM, set `display: none` or pause the animation by setting `animation-play-state: paused`.
1010

11+
SpinKit can also be installed to your project with `bower`:
12+
13+
```bash
14+
$ bower install spinkit
15+
```
16+
17+
If you're using SCSS in your project then you can include just the styles for the spinners that you want by adding the following to your main file:
18+
19+
```scss
20+
@import '../bower_components/spinkit/scss/spinners/1-rotating-plane',
21+
'../bower_components/spinkit/scss/spinners/3-wave';
22+
```
23+
24+
There are some variables that can be overridden if you use SCSS. The defaults are listed in [scss/_variables.scss](https://github.com/tobiasahlin/SpinKit/blob/master/scss/_variables.scss).
25+
1126
### Implementing a fallback spinner
1227

1328
An easy way to provide a fallback animation is to check for support for the `animation` property, and replace the spinner with a GIF if it's not supported.
@@ -18,10 +33,10 @@ function browserSupportsCSSProperty(propertyName) {
1833
propertyName = propertyName.toLowerCase();
1934

2035
if (elm.style[propertyName] != undefined)
21-
return true;
22-
36+
return true;
37+
2338
var propertyNameCapital = propertyName.charAt(0).toUpperCase() + propertyName.substr(1),
24-
domPrefixes = 'Webkit Moz ms O'.split(' ');
39+
domPrefixes = 'Webkit Moz ms O'.split(' ');
2540

2641
for (var i = 0; i < domPrefixes.length; i++) {
2742
if (elm.style[domPrefixes[i] + propertyNameCapital] != undefined)
@@ -36,10 +51,14 @@ Use it to check for `animation` support:
3651

3752
```javascript
3853
if (!browserSupportsCSSProperty('animation')) {
39-
// fallback…
54+
// fallback…
4055
}
4156
```
4257

4358
## Contribution
4459

4560
If you're submitting a new animation, make sure that it looks identical in [all browsers that support CSS animations](http://caniuse.com/css-animation).
61+
62+
The animation styles should be put in an [SCSS](http://sass-lang.com/) file which you place in [scss/spinners/](https://github.com/tobiasahlin/SpinKit/blob/master/scss/spinners). Carefully look at the existing spinners to make sure you follow the same conventions and that you list an example on top of the page exactly like the other spinners (we extract this when generating the HTML files). Don't use any browser prefixes as this will be added automatically to the generated CSS files by [autoprefixer](https://github.com/postcss/autoprefixer).
63+
64+
To generate the CSS and HTML files you need to have [node.js](http://nodejs.org/) installed on your system. After that you need to issue `npm install` from the SpinKit project directory to install [gulp](https://github.com/gulpjs/gulp) and other dependencies listed in `package.json`. After doing this you should be able to just call `gulp build` to generate the files. These files should be included in your pull requests.

0 commit comments

Comments
 (0)