{"name":"rtl-css-js","version":"1.13.0","description":"Right To Left conversion for CSS in JS objects","main":"dist/cjs/index.js","jsnext:main":"dist/esm/index.js","module":"dist/esm/index.js","types":"types.d.ts","scripts":{"add-contributor":"kcd-scripts contributors add","build":"rimraf dist && npm-run-all build:**","build:bundlers":"kcd-scripts build --bundle cjs,esm --environment BUILD_INPUT:src/*.js --no-clean","build:umd:main":"kcd-scripts build --bundle umd,umd.min BUILD_NAME:rtlCSSJS --no-clean","build:umd:core":"kcd-scripts build --bundle umd,umd.min --environment BUILD_NAME:rtlCSSJSCore,BUILD_FILENAME_SUFFIX:\".core\",BUILD_INPUT:src/core.js --no-clean","postbuild:bundlers":"node scripts/add-proxies-typings.js","lint":"kcd-scripts lint","test":"kcd-scripts test","test:update":"npm run test -s -- --coverage --updateSnapshot","validate":"kcd-scripts validate","precommit":"kcd-scripts precommit"},"keywords":["css-in-js","ltr","rtl","cssjanus"],"author":{"name":"Kent C. Dodds","email":"kent@doddsfamily.us","url":"http://kentcdodds.com/"},"license":"MIT","devDependencies":{"kcd-scripts":"^0.45.0","npm-run-all":"^4.1.1","rimraf":"^2.6.2","tiny-glob":"^0.2.0"},"eslintConfig":{"extends":"./node_modules/kcd-scripts/eslint.js"},"eslintIgnore":["node_modules","coverage","dist"],"repository":{"type":"git","url":"git+https://github.com/kentcdodds/rtl-css-js.git"},"bugs":{"url":"https://github.com/kentcdodds/rtl-css-js/issues"},"homepage":"https://github.com/kentcdodds/rtl-css-js#readme","dependencies":{"@babel/runtime":"^7.1.2"},"gitHead":"25cb86e411c0c0177307bbf66246740c4d5e5adf","_id":"rtl-css-js@1.13.0","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"kentcdodds","email":"kent@doddsfamily.us"},"dist":{"integrity":"sha512-zUydBqLfSKEk6XF+OiK1fmReAsnoZz0MKIYPsAfP4DZuCdLewtH7nDwXpnqd8jbL7J1pE9uCaOLTkfQGAFfJRw==","shasum":"e97ebb67dd9fc6c4be1278730901967fc432ed9f","tarball":"http://registry-npm.ywwl.com/rtl-css-js/download/rtl-css-js-1.13.0.tgz","fileCount":24,"unpackedSize":245240,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc8CCWCRA9TVsSAnZWagAA9uIP/jyBBktCmrJ309A+89ts\n2bthNtGI4iHW/GzAiZZgJ3i19qk+F49VLv254/2HrVVxmoiYpf6e6n9bljUM\nfkZv+D8FkQ6hJv+c8ek2X1uQBAmWSBlPR+yRRvFAhnKNjpbmUcdiYStyfWOY\njS6WKugRGxmEiuDD1dCHOHvPNhCKfuCVyZ5vQwDm24Wve1o75wtyGpnW+VJq\nUBprnW1wJd4wYmS/0CfYWOLMi3aw1avM2Y/nkNVJ70KLE4s4xH4bhrc8B3xd\n2dryBmPGfFZA6gW+4mGWbUAnX5abM+JFB8OdWb2/aXltR7ek2iSKUCb577RA\nw881DiC9atro9G1WYtdbu2fzkImV76k8UxRghPn+izLBVSTRQb67w4oQf/su\nNNRtPG4zNnqsXG3x5tEaZhCT/D8TIroP4jx0lZY1z/YoDeFc2jXboiJ4sEX/\nLflzNsHWI1DVk8AcGR8eNvN9X9XOfkj5fGpJTG7FlXWaFl8jWZPe2ZivClxZ\nHGW9b3x34CPdMVFRL2Ltt0lSN3o17iitbQPRbHVdXSs1XarKaiBt9Osg+v5m\nl//rWagMIlX/4BmkIfTMjKVWyd7jfTUbMqzYpydfkezAJVbe/AfXiplFBM9P\nvIvNNujCK3jBkWX1es+AlftphEL9beionsiYl3NjPqwUugJwADqQaUb/xofp\nae90\r\n=fu6R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAqott3pFp/ffs8TmfdDQt5lGHGgHJ9NtCyYfJlFlPQaAiEAkWeumSBIwv/rA5YMdlzyR9kfypRZx9D3L5VAzHImrk8="}],"size":51616,"noattachment":false,"key":"/rtl-css-js/-/rtl-css-js-1.13.0.tgz"},"maintainers":[{"name":"kentcdodds","email":"kent@doddsfamily.us"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rtl-css-js_1.13.0_1559240854041_0.3345756590070279"},"_hasShrinkwrap":false,"readme":"# rtl-css-js\n\nRTL conversion for CSS in JS objects\n\n<!-- prettier-ignore-start -->\n[![Build Status][build-badge]][build]\n[![Code Coverage][coverage-badge]][coverage]\n[![version][version-badge]][package]\n[![downloads][downloads-badge]][npmtrends]\n[![MIT License][license-badge]][license]\n[![All Contributors][all-contributors-badge]](#contributors-)\n[![PRs Welcome][prs-badge]][prs]\n[![Code of Conduct][coc-badge]][coc]\n<!-- prettier-ignore-end -->\n\n## The problem\n\nFor some locales, it's necessary to change `padding-left` to `padding-right`\nwhen your text direction is right to left. There are tools like this for CSS\n([`cssjanus`](https://github.com/cssjanus/cssjanus) for example) which\nmanipulate strings of CSS to do this, but none for CSS in JS where your CSS is\nrepresented by an object.\n\n## This solution\n\nThis is a function which accepts a CSS in JS object and can convert\n`padding-left` to `padding-right` as well as all other properties where it makes\nsense to do that (at least, that's what it's going to be when it's done... This\nis a work in progress).\n\n## Table of Contentss\n\n<!-- START doctoc generated TOC please keep comment here to allow auto update -->\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [kebab-case](#kebab-case)\n  - [core](#core)\n- [Caveats](#caveats)\n  - [`background`](#background)\n  - [CSS variables - `var()`](#css-variables---var)\n- [Inspiration](#inspiration)\n- [Ecosystem](#ecosystem)\n- [Other Solutions](#other-solutions)\n- [Contributors](#contributors)\n- [LICENSE](#license)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `dependencies`:\n\n```\nnpm install --save rtl-css-js\n```\n\n## Usage\n\nThis module is exposed via [CommonJS](http://wiki.commonjs.org/wiki/CommonJS) as\nwell as [UMD](https://github.com/umdjs/umd) with the global as `rtlCSSJS`\n\nCommonJS:\n\n```javascript\nconst rtlCSSJS = require('rtl-css-js')\nconst styles = rtlCSSJS({paddingLeft: 23})\nconsole.log(styles) // logs {paddingRight: 23}\n```\n\nYou can also just include a script tag in your browser and use the `rtlCSSJS`\nvariable:\n\n```html\n<script src=\"https://unpkg.com/rtl-css-js\"></script>\n<script>\n  const styles = rtlCSSJS({paddingRight: 23})\n  console.log(styles) // logs {paddingLeft: 23}\n</script>\n```\n\nYou can also control which rules you don't want to flip by adding a\n`/* @noflip */` CSS comment to your rule\n\n```javascript\nconst rtlCSSJS = require('rtl-css-js')\nconst styles = rtlCSSJS({paddingLeft: '20px /* @noflip */'})\nconsole.log(styles) // logs {paddingLeft: '20px /* @noflip */' }\n```\n\n### kebab-case\n\nThis library support kebab-case properties too.\n\n```javascript\nconst rtlCSSJS = require('rtl-css-js')\nconst styles = rtlCSSJS({'padding-right': 23})\nconsole.log(styles) // logs {'padding-left': 23}\n```\n\n### core\n\n`rtl-css-js` also exposes its internal helpers and utilities so you can deal\nwith [certain scenarios](https://github.com/kentcdodds/rtl-css-js/pull/22)\nyourself. To use these you can use the `rtlCSSJSCore` global with the UMD build,\n`require('rtl-css-js/core')`, or use\n`import {propertyValueConverters, arrayToObject} from 'rtl-css-js/core'`.\n\nYou can import anything that's exported from `src/core`. Please see the code\ncomments for documentation on how to use these.\n\n## Caveats\n\n### `background`\n\nRight now `background` and `backgroundImage` just replace all instances of `ltr`\nwith `rtl` and `right` with `left`. This is so you can have a different image\nfor your LTR and RTL, and in order to flip linear gradients. Note that this is\ncase sensitive! Must be lower case. Note also that it _will not_ change `bright`\nto `bleft`. It's a _little_ smarter than that. But this is definitely something\nto consider with your URLs.\n\n### CSS variables - `var()`\n\nSince it's impossible to know what the contents of a css variable are until the\nstyles are actually calculated by the browser, any CSS variable contents will\nnot be converted.\n\n## Inspiration\n\n[CSSJanus](https://github.com/cssjanus/cssjanus) was a major inspiration.\n\n## Ecosystem\n\n- **[react-with-styles-interface-aphrodite](https://github.com/airbnb/react-with-styles-interface-aphrodite):**\n  An interface to use\n  [`react-with-styles`](https://github.com/airbnb/react-with-styles) with\n  [Aphrodite](https://github.com/khan/aphrodite)\n- **[fela-plugin-rtl](https://www.npmjs.com/package/fela-plugin-rtl):** A plugin\n  for [fela](http://fela.js.org/) that uses rtl-css-js to convert a style object\n  to its right-to-left counterpart\n- **[bidi-css-js](https://github.com/TxHawks/bidi-css-js):** A library for\n  authoring flow-relative css, which uses `rtl-css-js`'s core.\n- **[jss-rtl](https://github.com/alitaheri/jss-rtl):** A plugin for\n  [`jss`](https://github.com/cssinjs/jss) to support flipping styles\n  dynamically.\n\n## Other Solutions\n\nI'm not aware of any, if you are please\n[make a pull request](http://makeapullrequest.com) and add it here!\n\n## Contributors\n\nThanks goes to these people ([emoji key][emojis]):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://kentcdodds.com\"><img src=\"https://avatars.githubusercontent.com/u/1500684?v=3?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Kent C. Dodds</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=kentcdodds\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=kentcdodds\" title=\"Tests\">⚠️</a> <a href=\"#infra-kentcdodds\" title=\"Infrastructure (Hosting, Build-Tools, etc)\">🚇</a></td>\n    <td align=\"center\"><a href=\"https://gabri.me\"><img src=\"https://avatars.githubusercontent.com/u/63876?v=3?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ahmed El Gabri</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=ahmedelgabri\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=ahmedelgabri\" title=\"Documentation\">📖</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=ahmedelgabri\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/majapw\"><img src=\"https://avatars1.githubusercontent.com/u/1383861?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Maja Wichrowska</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=majapw\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=majapw\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/yzimet\"><img src=\"https://avatars2.githubusercontent.com/u/6600720?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Yaniv</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=yzimet\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=yzimet\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/TxHawks\"><img src=\"https://avatars2.githubusercontent.com/u/5658514?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Jonathan Pollak</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=TxHawks\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=TxHawks\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/alitaheri\"><img src=\"https://avatars1.githubusercontent.com/u/8528759?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ali Taheri Moghaddar</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=alitaheri\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=alitaheri\" title=\"Documentation\">📖</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=alitaheri\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/garrettberg\"><img src=\"https://avatars0.githubusercontent.com/u/844459?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>garrettberg</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=garrettberg\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=garrettberg\" title=\"Tests\">⚠️</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"http://milesj.me\"><img src=\"https://avatars2.githubusercontent.com/u/143744?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Miles Johnson</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=milesj\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=milesj\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://www.kweber.com\"><img src=\"https://avatars1.githubusercontent.com/u/2785791?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Kevin Weber</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=kevinweber\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://stackshare.io/jdorfman/decisions\"><img src=\"https://avatars1.githubusercontent.com/u/398230?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Justin Dorfman</b></sub></a><br /><a href=\"#fundingFinding-jdorfman\" title=\"Funding Finding\">🔍</a></td>\n    <td align=\"center\"><a href=\"https://github.com/RoystonS\"><img src=\"https://avatars0.githubusercontent.com/u/19773?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Royston Shufflebotham</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/issues?q=author%3ARoystonS\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=RoystonS\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=RoystonS\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://twitter.com/layershifter\"><img src=\"https://avatars.githubusercontent.com/u/14183168?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Oleksandr Fediashov</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=layershifter\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/ling1726\"><img src=\"https://avatars.githubusercontent.com/u/20744592?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Lingfan Gao</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=ling1726\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=ling1726\" title=\"Tests\">⚠️</a></td>\n    <td align=\"center\"><a href=\"https://github.com/miroslavstastny\"><img src=\"https://avatars.githubusercontent.com/u/9615899?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Miroslav Stastny</b></sub></a><br /><a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=miroslavstastny\" title=\"Code\">💻</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=miroslavstastny\" title=\"Documentation\">📖</a> <a href=\"https://github.com/kentcdodds/rtl-css-js/commits?author=miroslavstastny\" title=\"Tests\">⚠️</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the [all-contributors][all-contributors] specification.\nContributions of any kind welcome!\n\n## LICENSE\n\nMIT\n\n<!-- prettier-ignore-start -->\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://img.shields.io/github/workflow/status/kentcdodds/rtl-css-js/validate?logo=github&style=flat-square\n[build]: https://github.com/kentcdodds/rtl-css-js/actions?query=workflow%3Avalidate\n[coverage-badge]: https://img.shields.io/codecov/c/github/kentcdodds/rtl-css-js.svg?style=flat-square\n[coverage]: https://codecov.io/github/kentcdodds/rtl-css-js\n[version-badge]: https://img.shields.io/npm/v/rtl-css-js.svg?style=flat-square\n[package]: https://www.npmjs.com/package/rtl-css-js\n[downloads-badge]: https://img.shields.io/npm/dm/mdx-bundler.svg?style=flat-square\n[npmtrends]: https://www.npmtrends.com/mdx-bundler\n[license-badge]: https://img.shields.io/npm/l/rtl-css-js.svg?style=flat-square\n[license]: https://github.com/kentcdodds/rtl-css-js/blob/main/other/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[coc]: https://github.com/kentcdodds/rtl-css-js/blob/main/other/CODE_OF_CONDUCT.md\n[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key\n[all-contributors]: https://github.com/kentcdodds/all-contributors\n<!-- prettier-ignore-end -->\n","publish_time":1559240854253,"_cnpm_publish_time":1559240854253,"dist-tags":{"beta":"1.0.0-beta.4","latest":"1.16.1"}}