You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-4Lines changed: 23 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,21 @@ SpinKit uses CSS animations to create smooth and easily customizable animations.
8
8
9
9
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`.
10
10
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:
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
+
11
26
### Implementing a fallback spinner
12
27
13
28
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) {
18
33
propertyName =propertyName.toLowerCase();
19
34
20
35
if (elm.style[propertyName] !=undefined)
21
-
returntrue;
22
-
36
+
returntrue;
37
+
23
38
var propertyNameCapital =propertyName.charAt(0).toUpperCase() +propertyName.substr(1),
24
-
domPrefixes ='Webkit Moz ms O'.split('');
39
+
domPrefixes ='Webkit Moz ms O'.split('');
25
40
26
41
for (var i =0; i <domPrefixes.length; i++) {
27
42
if (elm.style[domPrefixes[i] + propertyNameCapital] !=undefined)
@@ -36,10 +51,14 @@ Use it to check for `animation` support:
36
51
37
52
```javascript
38
53
if (!browserSupportsCSSProperty('animation')) {
39
-
// fallback…
54
+
// fallback…
40
55
}
41
56
```
42
57
43
58
## Contribution
44
59
45
60
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