Skip to content

Commit

Permalink
Merge pull request #94 from tobiasahlin/release-121
Browse files Browse the repository at this point in the history
Release 1.2.1
  • Loading branch information
tobiasahlin committed Jul 26, 2015
2 parents eb7c21b + 030098d commit d29d104
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 1.2.1

* Fixed: Two spinners didn't look the same on Android
* Changed: Bumped default top and bottom margin to 40px

# 1.2.0

* Added: Folding cube spinner
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
# [SpinKit](http://tobiasahlin.com/spinkit/)

Simple loading spinners animated with CSS. See [demo](http://tobiasahlin.com/spinkit/).

SpinKit uses CSS animations to create smooth and easily customizable animations. The goal is not to offer a solution that works in every browser—if you're supporting browsers that haven't implemented the CSS `animation` property (e.g. IE9 and below), you'll want to detect support for the `animation` property, and implement a fallback (see below.)
Simple loading spinners animated with CSS. See [demo](http://tobiasahlin.com/spinkit/). SpinKit uses hardware accelerated (`translate` and `opacity`) CSS animations to create smooth and easily customizable animations.

## Usage

### Regular CSS

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`.

SpinKit can also be installed to your project with `bower`:
Grab the HTML and CSS for a spinner from the example files, or add SpinKit directly to your project with `bower`:

```bash
$ bower install spinkit
```

or npm:

```bash
$ npm install spinkit
```

### SCSS

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:
If you're using SCSS you can include specific spinners (rather than all of them) by importing them one by one:

```scss
@import '../bower_components/spinkit/scss/spinners/1-rotating-plane',
'../bower_components/spinkit/scss/spinners/3-wave';
```

Please note that you currently need to use [autoprefixer](https://github.com/postcss/autoprefixer) in your project if you want to support all browsers. If you're compiling your SCSS with gulp you can use [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer) or if you use grunt then [grunt-autoprefixer](https://github.com/nDmitry/grunt-autoprefixer) is a good choice.
You currently need to use an [autoprefixer](https://github.com/postcss/autoprefixer) if you want to support all browsers. If you're compiling your SCSS with gulp you can use [gulp-autoprefixer](https://github.com/sindresorhus/gulp-autoprefixer), and [grunt-autoprefixer](https://github.com/nDmitry/grunt-autoprefixer) if you use grunt.

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).
Variables that can be overridden are listed in [scss/_variables.scss](https://github.com/tobiasahlin/SpinKit/blob/master/scss/_variables.scss).

## Old web browser compatibility
## Web browser compatibility

With support for CSS animations in every current browser and [almost 90% of all browsers in use today](http://caniuse.com/#feat=css-animation), the need for GIF and JavaScript fallbacks is decreasing quickly. If you still need to support those last few then this section is for you.
CSS animations are supported in the latest version of all major browsers, and browsers with `animation` support make up [almost 90% of all usage](http://caniuse.com/#feat=css-animation). If you need to support IE9 and below, however, this section is for you.

### Implementing a fallback spinner

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.
How do you know if you need to provide a fallback? You can easily check for animation support with [Modernizr](http://modernizr.com), or manually check for the `animation` property, and replace the spinner with a GIF if it's not supported:

```javascript
function browserSupportsCSSProperty(propertyName) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "spinkit",
"version": "1.2.0",
"version": "1.2.1",
"description": "A collection of loading indicators animated with CSS",
"main": "gulpfile.js",
"scripts": {
Expand Down

0 comments on commit d29d104

Please sign in to comment.