{"name":"postcss-logical","description":"Use logical properties and values in CSS","version":"8.1.0","contributors":[{"name":"Antonio Laguna","email":"antonio@laguna.es","url":"https://antonio.laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"},{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"}],"license":"MIT-0","funding":[{"type":"github","url":"https://github.com/sponsors/csstools"},{"type":"opencollective","url":"https://opencollective.com/csstools"}],"engines":{"node":">=18"},"type":"module","main":"dist/index.cjs","module":"dist/index.mjs","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"},"require":{"default":"./dist/index.cjs"}}},"dependencies":{"postcss-value-parser":"^4.2.0"},"peerDependencies":{"postcss":"^8.4"},"scripts":{},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical#readme","repository":{"type":"git","url":"git+https://github.com/csstools/postcss-plugins.git","directory":"plugins/postcss-logical"},"bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"keywords":["align","block","border","css","dir","directional","directions","end","flow","inline","logical","ltr","margin","padding","postcss","postcss-plugin","properties","property","relative","rtl","size","start","text","values"],"_id":"postcss-logical@8.1.0","gitHead":"d60448e9f7114b5f57667786127a7aa9240e21c6","types":"./dist/index.d.ts","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-pL1hXFQ2fEXNKiNiAgtfA005T9FBxky5zkX6s4GZM2D8RkVgRqz3f4g1JUoq925zXv495qk8UNldDwh8uGEDoA==","shasum":"4092b16b49e3ecda70c4d8945257da403d167228","tarball":"http://registry-npm.ywwl.com/postcss-logical/download/postcss-logical-8.1.0.tgz","fileCount":7,"unpackedSize":32998,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCmoQtb+ZIAD9VESfwi9cnBTp8YOK6i3aak0Oz6GzCr2wIhAMagn+i8AwtR2Ly/igzUJyU68+Xo2eld7762VhIV7x+e"}],"size":6512,"noattachment":false,"key":"/postcss-logical/-/postcss-logical-8.1.0.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-logical_8.1.0_1740330324930_0.3564882314282689"},"_hasShrinkwrap":false,"readme":"# PostCSS Logical Properties and Values [<img src=\"https://postcss.github.io/postcss/logo.svg\" alt=\"PostCSS Logo\" width=\"90\" height=\"90\" align=\"right\">][PostCSS]\n\n`npm install postcss-logical --save-dev`\n\n[PostCSS Logical Properties and Values]  lets you use logical, rather than physical, direction and dimension mappings in CSS, following the [CSS Logical Properties and Values] specification.\n\n```css\n.element {\n\tblock-size: 100px;\n\tmax-inline-size: 400px;\n\tinline-size: 200px;\n\tpadding-block: 10px 20px;\n\tmargin-inline: auto;\n\tborder-block-width: 2px;\n\tborder-block-style: solid;\n}\n\n/* becomes */\n\n.element {\n\theight: 100px;\n\tmax-width: 400px;\n\twidth: 200px;\n\tpadding-top: 10px;\n\tpadding-bottom: 20px;\n\tmargin-left: auto;\n\tmargin-right: auto;\n\tborder-top-width: 2px;\n\tborder-bottom-width: 2px;\n\tborder-top-style: solid;\n\tborder-bottom-style: solid;\n}\n```\n\n## Usage\n\nAdd [PostCSS Logical Properties and Values] to your project:\n\n```bash\nnpm install postcss postcss-logical --save-dev\n```\n\nUse it as a [PostCSS] plugin:\n\n```js\nconst postcss = require('postcss');\nconst postcssLogical = require('postcss-logical');\n\npostcss([\n\tpostcssLogical(/* pluginOptions */)\n]).process(YOUR_CSS /*, processOptions */);\n```\n\n\n\n## Options\n\n### `blockDirection` and `inlineDirection`\n\nThe `blockDirection` and `inlineDirection` options allow you to specify the direction of the block and inline axes. The default values are `top-to-bottom` and `left-to-right` respectively, which would match any latin language.\n\n**You should tweak these values so that they are specific to your language and writing mode.**\n\n```js\npostcssLogical({\n\tblockDirection: 'right-to-left',\n\tinlineDirection: 'top-to-bottom'\n})\n```\n\n```css\n.element {\n\tblock-size: 100px;\n\tmax-inline-size: 400px;\n\tinline-size: 200px;\n\tpadding-block: 10px 20px;\n\tmargin-inline: auto;\n\tborder-block-width: 2px;\n\tborder-block-style: solid;\n}\n\n/* becomes */\n\n.element {\n\twidth: 100px;\n\tmax-height: 400px;\n\theight: 200px;\n\tpadding-right: 10px;\n\tpadding-left: 20px;\n\tmargin-top: auto;\n\tmargin-bottom: auto;\n\tborder-right-width: 2px;\n\tborder-left-width: 2px;\n\tborder-right-style: solid;\n\tborder-left-style: solid;\n}\n```\n\nEach direction must be one of the following:\n\n- `top-to-bottom`\n- `bottom-to-top`\n- `left-to-right`\n- `right-to-left`\n\nYou can't mix two vertical directions or two horizontal directions so for example `top-to-bottom` and `right-to-left` are valid, but `top-to-bottom` and `bottom-to-top` are not.\n\nPlease do note that `text-align` won't be transformed if `inlineDirection` becomes vertical.\n\n### `ignoreCustomProperties`\n\nThe `ignoreCustomProperties` option allows you to ignore any properties containing `var()`.  \n`postcss-logical` assumes that all custom properties are single value (e.g. `--foo: 10px;`) and will assign these to physical properties as fallbacks for logical properties.  \n\nThis will produce broken declarations when your custom properties contain multiple values instead (e.g. `--foo: 1px 2px;`).\n\n```css\n:root {\n\t--inset-a: 10px;\n}\n\n.foo {\n\tinset: var(--inset-a);\n}\n\n:root {\n\t--inset-b: 1px 2px 3px 4px;\n}\n\n.bar {\n\tinset: var(--inset-b);\n}\n\n/* becomes */\n\n:root {\n\t--inset-a: 10px;\n}\n\n.foo {\n\ttop: var(--inset-a);\n\tright: var(--inset-a);\n\tbottom: var(--inset-a);\n\tleft: var(--inset-a);\n}\n\n:root {\n\t--inset-b: 1px 2px 3px 4px;\n}\n\n.bar {\n\ttop: var(--inset-b);\n\tright: var(--inset-b);\n\tbottom: var(--inset-b);\n\tleft: var(--inset-b);\n}\n```\n\nWith `ignoreCustomProperties` set to `true`:\n\n```css\n:root {\n\t--inset-a: 10px;\n}\n\n.foo {\n\tinset: var(--inset-a);\n}\n\n:root {\n\t--inset-b: 1px 2px 3px 4px;\n}\n\n.bar {\n\tinset: var(--inset-b);\n}\n\n/* becomes */\n\n:root {\n\t--inset-a: 10px;\n}\n\n.foo {\n\tinset: var(--inset-a);\n}\n\n:root {\n\t--inset-b: 1px 2px 3px 4px;\n}\n\n.bar {\n\tinset: var(--inset-b);\n}\n```\n\n[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test\n[css-url]: https://cssdb.org/#logical-properties-and-values\n[discord]: https://discord.gg/bUadyRwkJS\n[npm-url]: https://www.npmjs.com/package/postcss-logical\n\n[PostCSS]: https://github.com/postcss/postcss\n[PostCSS Logical Properties and Values]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical\n[CSS Logical Properties and Values]: https://www.w3.org/TR/css-logical-1/\n","publish_time":1740330325088,"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_cnpm_publish_time":1740330325088,"dist-tags":{"latest":"9.0.2"}}