Skip to content

Commit

Permalink
docs: add animation docs
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Feb 25, 2018
1 parent 358aa8c commit 6bcf78d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
24 changes: 10 additions & 14 deletions .storybook/css/Button.tsx
@@ -1,24 +1,20 @@
import {Component, createElement as h} from 'react';
import css from '../../src/react/css';

@css
@css({
width: '320px',
borderRadius: '5px',
border: 'none',
outline: 'none',
'&:hover': {
color: '#fff',
},
'&:active': {
position: 'relative',
top: '2px',
},
})
class Button extends Component<any, any> {
static css = {
borderRadius: '5px',
border: 'none',
outline: 'none',
'&:hover': {
color: '#fff',
},
'&:active': {
position: 'relative',
top: '2px',
},
};

@css(function({props}) {
return {
padding: '20px',
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -31,6 +31,7 @@ it is *lightning fast*, *lean*, and with *gazillion* [__*feat*ures__](#feat).
- __[Atoms](./docs/en/feat/atoms.md)__
- [__Media queries__, keyframes, ...](./docs/en/feat/media.md)
- [__Global__ styles](./docs/en/feat/global.md)
- Global [entry and exit animations](./docs/en/feat/animation.md)
- [CSS __resets__](./docs/en/feat/resets.md)
- __[Theming](./docs/en/feat/theming.md)__

Expand Down
19 changes: 19 additions & 0 deletions docs/en/animation.md
@@ -0,0 +1,19 @@
# Entry and Exit Animations

Expose below classes to easily do entry and exit animations:

- `fiOpacity` &mdash; enter by changing opacity.
- `fiAll` &mdash; enter by scaling and changing opacity.
- `foOpacity` &mdash; exit by changing opacity.
- `foAll` &mdash; exit by scaling and changing opacity.


## Usage

```jsx
import CssFadeInAnimations from 'freestyler/lib/globals/CssFadeInAnimations';
import CssFadeOutAnimations from 'freestyler/lib/globals/CssFadeOutAnimations';

<CssFadeInAnimations />
<CssFadeOutAnimations />
```

0 comments on commit 6bcf78d

Please sign in to comment.