{"name":"postcss-logical","description":"Use logical properties and values in CSS","version":"9.0.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":">=20.19.0"},"type":"module","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"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"],"gitHead":"755e92402306dbddd0ad66a8d902e35a62c21c2a","_id":"postcss-logical@9.0.0","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-A4LNd9dk3q/juEUA9Gd8ALhBO3TeOeYurnyHLlf2aAToD94VHR8c5Uv7KNmf8YVRhTxvWsyug4c5fKtARzyIRQ==","shasum":"76d09cf580aef4af7987a63a69675e8a84feffa4","tarball":"http://registry-npm.ywwl.com/postcss-logical/download/postcss-logical-9.0.0.tgz","fileCount":6,"unpackedSize":20444,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCkbfXzoYAfpY5pmtgtV44PowrBgP0sJ+AzTJls/N5AvwIga4Grx6xIy88FxFYWyruDMs/Pib957jjbyZsgWB8vtYk="}],"size":6039,"noattachment":false,"key":"/postcss-logical/-/postcss-logical-9.0.0.tgz"},"_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"directories":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-logical_9.0.0_1768375393453_0.8112823584907194"},"_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":1768375393588,"_cnpm_publish_time":1768375393588,"dist-tags":{"latest":"9.0.2"}}