Skip to content

Commit

Permalink
feat: add basic rtl addon implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Mar 22, 2018
1 parent a26da08 commit c7b901d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 15 additions & 0 deletions addon/rtl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var flip = require('rtl-css-js')

exports.addon = function (renderer) {
if (process.env.NODE_ENV !== 'production') {
require('./__dev__/warnOnMissingDependencies')('rtl', renderer, ['put']);
}

var put = renderer.put;

renderer.put = function (selector, css) {
return put(selector, flip(css));
};
};
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nano-css",
"version": "1.4.1",
"version": "1.6.0",
"description": "Smallest 5th gen CSS-in-JS library",
"main": "index.js",
"unpkg": "dist/nano-css.umd.min.js",
Expand Down Expand Up @@ -37,7 +37,8 @@
"dependencies": {
"fastest-stable-stringify": "^1.0.1",
"stylis": "3.5.0",
"inline-style-prefixer": "^4.0.0"
"inline-style-prefixer": "^4.0.0",
"rtl-css-js": "^1.9.0"
},
"devDependencies": {
"@types/react": "16.0.40",
Expand Down

0 comments on commit c7b901d

Please sign in to comment.