Skip to content

Commit

Permalink
Merge pull request #21 from streamich/feat/global-css
Browse files Browse the repository at this point in the history
Feat/global css
  • Loading branch information
streamich authored Mar 18, 2018
2 parents 34f1385 + 45ff58f commit a44f8bf
Show file tree
Hide file tree
Showing 50 changed files with 1,133 additions and 59 deletions.
33 changes: 33 additions & 0 deletions .storybook/animate.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {createElement as h} from 'react';
import {storiesOf} from '@storybook/react';
const {action} = require('@storybook/addon-actions');
const {linkTo} = require('@storybook/addon-links');
const {create} = require('../index');
const {addon: addonRule} = require('../addon/rule');
const {addon: addonKeyframes} = require('../addon/keyframes');

const animations = [
'fadeIn',
'fadeInDown',
'fadeInExpand',
];

const nano = create();
addonRule(nano);
addonKeyframes(nano);
const {rule} = nano;

var className = rule({
width: '200px',
height: '200px',
background: 'red',
});

let stories = storiesOf('Addons/Animate', module);

animations.forEach(name => {
stories = stories.add(name, () => {
require('../addon/animate/' + name).addon(nano);
return h('div', {className: name + className});
});
});
14 changes: 14 additions & 0 deletions .storybook/global-css.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {createElement as h} from 'react';
import {storiesOf} from '@storybook/react';
const {action} = require('@storybook/addon-actions');
const {linkTo} = require('@storybook/addon-links');
const {create} = require('../index');
const {addon: resetEricMeyerCondensed} = require('../addon/reset/EricMeyerCondensed');

const nano = create();
resetEricMeyerCondensed(nano);

storiesOf('CSS resets', module)
.add('Eric Meyer - condensed', () =>
h('div', null, 'Hello world')
)
24 changes: 24 additions & 0 deletions .storybook/stylis.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {createElement as h} from 'react';
import {storiesOf} from '@storybook/react';
const {action} = require('@storybook/addon-actions');
const {linkTo} = require('@storybook/addon-links');
const {create} = require('../index');
const {addon: addonStylis} = require('../addon/stylis');
const {addon: addonRule} = require('../addon/rule');

const renderer = create({h});
addonStylis(renderer);
addonRule(renderer);
const {rule} = renderer;

const className = rule(`
color: red;
&:hover {
color: blue;
}
`);

storiesOf('Addons/stylis', module)
.add('Default', () =>
h('div', {className}, 'Hello world')
)
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ node_js:
- '8'
script:
- npm run test
- npm run build
matrix:
allow_failures: []
fast_finish: true
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ __Tiny [5<sup>th</sup> generation](https://github.com/streamich/freestyler/blob/
- [`nesting`](./docs/nesting.md)
- [`keyframes()`](./docs/keyframes.md)
- [`hydrate`](./docs/hydrate.md)
- [`stylis`](./docs/stylis.md)
- [`unitless`](./docs/unitless.md)
- [`!important`](./docs/important.md)
- [`:global`](./docs/global.md)
- [Animations](./docs/animations.md)
- [CSS resets](./docs/resets.md)
- [Server-side rendering](./docs/SSR.md)


Expand Down
Loading

0 comments on commit a44f8bf

Please sign in to comment.