{ "manifest": { "name": "rtl-css-js", "version": "1.16.1", "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", "exports": { ".": { "types": "./types.d.ts", "node": "./dist/cjs/index.js", "import": "./dist/esm/index.js", "default": "./dist/cjs/index.js" }, "./core": { "types": "./core.d.ts", "node": "./dist/cjs/core.js", "import": "./dist/esm/core.js", "default": "./dist/cjs/core.js" }, "./core.esm": { "default": "./dist/esm/core.js" }, "./core.esm.js": { "default": "./dist/esm/core.js" }, "./core.js": { "default": "./dist/cjs/core.js" }, "./package.json": "./package.json" }, "scripts": { "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" }, "husky": { "hooks": { "pre-commit": "kcd-scripts pre-commit" } }, "files": [ "dist", "core", "types.d.ts", "core.d.ts", "core.esm.js", "core.esm.d.ts" ], "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": "^1.11.0", "npm-run-all": "^4.1.1", "rimraf": "^3.0.0", "tiny-glob": "^0.2.0" }, "eslintConfig": { "extends": "./node_modules/kcd-scripts/eslint.js" }, "eslintIgnore": [ "node_modules", "coverage", "dist" ], "repository": { "type": "git", "url": "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" }, "_registry": "npm", "_loc": "/home/josie/.cache/yarn/v6/npm-rtl-css-js-1.16.1-integrity/node_modules/rtl-css-js/package.json", "readmeFilename": "README.md", "readme": "# rtl-css-js\n\nRTL conversion for CSS in JS objects\n\n\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\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\n\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\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\n\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\n\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\"\"/
Kent C. Dodds

💻 ⚠️ 🚇
\"\"/
Ahmed El Gabri

💻 📖 ⚠️
\"\"/
Maja Wichrowska

💻 ⚠️
\"\"/
Yaniv

💻 ⚠️
\"\"/
Jonathan Pollak

💻 ⚠️
\"\"/
Ali Taheri Moghaddar

💻 📖 ⚠️
\"\"/
garrettberg

💻 ⚠️
\"\"/
Miles Johnson

💻 ⚠️
\"\"/
Kevin Weber

💻
\"\"/
Justin Dorfman

🔍
\"\"/
Royston Shufflebotham

🐛 💻 ⚠️
\"\"/
Oleksandr Fediashov

💻
\"\"/
Lingfan Gao

💻 ⚠️
\"\"/
Miroslav Stastny

💻 📖 ⚠️
\n\n\n\n\n\n\nThis project follows the [all-contributors][all-contributors] specification.\nContributions of any kind welcome!\n\n## LICENSE\n\nMIT\n\n\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\n", "licenseText": "The MIT License (MIT)\nCopyright (c) 2017 Kent C. Dodds\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n" }, "artifacts": [], "remote": { "resolved": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.1.tgz", "type": "tarball", "reference": "https://registry.npmjs.org/rtl-css-js/-/rtl-css-js-1.16.1.tgz", "hash": "", "integrity": "sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg==", "registry": "npm", "packageName": "rtl-css-js", "cacheIntegrity": "sha512-lRQgou1mu19e+Ya0LsTvKrVJ5TYUbqCVPAiImX3UfLTenarvPUl1QFdvu5Z3PYmHT9RCcwIfbjRQBntExyj3Zg== sha1-S0i0NUsP+RejBIjZUQD79yGaPoA=" }, "registry": "npm", "hash": "951420a2ed66bb5f5ef986b42ec4ef2ab549e536146ea0953c0888997dd47cb4de9daaef3d497540576fbb96773d89874fd44273021f6e3450067b44c728f766" }