{"_id":"postcss-logical@9.0.1","bugs":{"url":"https://github.com/csstools/postcss-plugins/issues"},"dist":{"shasum":"8dbaf302f812f0554b9824b8ee7389ed9c260712","tarball":"http://registry-npm.ywwl.com/postcss-logical/download/postcss-logical-9.0.1.tgz","fileCount":6,"integrity":"sha512-UzXqv8xhhdiu2AVpVUXK5yq7iqMOToivN+ttlQiEICDi4Dz6pfIyX6dEOVXOmd5gply0Rq7iqSu5KSKSr3Ti8Q==","signatures":[{"sig":"MEYCIQCRaIbTYgH4gfiJu1N9/mcOqjpoBJJlUEy+Ql+RxmoPtgIhAJCv7081eXelzLUntrGxD3USsj70556vHJhLuXwgesni","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICdoJOENWKIyCoWAGnLs+Z/gX5fUV4uommBg/LKZoo9ZAiBXIKV5pCEfCtUltLW4UphKt4exIg7AngiIYKiXfgPrig=="}],"unpackedSize":20544,"size":6057,"noattachment":false,"key":"/postcss-logical/-/postcss-logical-9.0.1.tgz"},"name":"postcss-logical","type":"module","engines":{"node":">=20.19.0"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.mjs"}},"funding":[{"url":"https://github.com/sponsors/csstools","type":"github"},{"url":"https://opencollective.com/csstools","type":"opencollective"}],"gitHead":"4c273cd4d774d697092e3b3b22d54ebd17236d98","license":"MIT-0","scripts":{},"version":"9.0.1","_npmUser":{"name":"romainmenke","email":"romainmenke@gmail.com"},"homepage":"https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical#readme","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"],"repository":{"url":"git+https://github.com/csstools/postcss-plugins.git","type":"git","directory":"plugins/postcss-logical"},"_npmVersion":"11.13.0","description":"Use logical properties and values in CSS","directories":{},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"alaguna","email":"sombragriselros@gmail.com"},{"name":"romainmenke","email":"romainmenke@gmail.com"}],"_nodeVersion":"26.1.0","contributors":[{"url":"https://antonio.laguna.es","name":"Antonio Laguna","email":"antonio@laguna.es"},{"name":"Romain Menke","email":"romainmenke@gmail.com"},{"name":"Jonathan Neal","email":"jonathantneal@hotmail.com"}],"dependencies":{"postcss-value-parser":"^4.2.0"},"_hasShrinkwrap":false,"peerDependencies":{"postcss":"^8.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/postcss-logical_9.0.1_1790346010272_0.452042858921045"},"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":1790346010358,"_cnpm_publish_time":1790346010358,"dist-tags":{"latest":"9.0.2"}}