Skip to content

Commit

Permalink
feat: create react preset
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 24, 2018
1 parent f7ce4eb commit 69b0c4e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ __Motto of `nano-css` is simple__: *create the smallest possible CSS-in-JS libra
- __Performant__ &mdash; does not create wrapper components, does not use inline styles or inline `<style>` elements in the document body, but caches all class names for re-use and injects CSS using `.insertRule()` for performance
- __`@media` queries__ and __animation `@keyframes`__ are supported
- __Auto-prefixes__ your styles
- Can __extract CSS__ into external style sheet
- __100% test coverage__ for [recommended setup](./docs/Installation.md#recommended-setup)
- __Extract CSS__ into external style sheet
- __Public domain__ &mdash; [Unlicense license](./LICENSE)


Expand Down
26 changes: 26 additions & 0 deletions preset/react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
'use strict';

var create = require('../index').create;
var addonCache = require('../addon/cache').addon;
var addonStable = require('../addon/stable').addon;
var addonNesting = require('../addon/nesting').addon;
var addonAtoms = require('../addon/atoms').addon;
var addonKeyframes = require('../addon/keyframes').addon;
var addonRule = require('../addon/rule').addon;
var addonSheet = require('../addon/sheet').addon;
var addonJsx = require('../addon/jsx').addon;

exports.preset = function (config) {
var nano = create(config);

addonCache(nano);
addonStable(nano);
addonNesting(nano);
addonAtoms(nano);
addonKeyframes(nano);
addonRule(nano);
addonSheet(nano);
addonJsx(nano);

return nano;
};

0 comments on commit 69b0c4e

Please sign in to comment.