{"id":19652995,"url":"https://github.com/csstools/stylelint-use-logical","last_synced_at":"2025-09-08T13:38:32.301Z","repository":{"id":33059702,"uuid":"150532997","full_name":"csstools/stylelint-use-logical","owner":"csstools","description":"Enforce usage of logical properties and values in CSS","archived":false,"fork":false,"pushed_at":"2024-12-27T18:26:57.000Z","size":119,"stargazers_count":66,"open_issues_count":9,"forks_count":10,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-08-18T00:33:47.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csstools.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-09-27T05:26:23.000Z","updated_at":"2025-07-10T20:05:03.000Z","dependencies_parsed_at":"2024-04-13T21:22:42.052Z","dependency_job_id":"d4993ee3-44bc-4d72-a585-5088decfdde5","html_url":"https://github.com/csstools/stylelint-use-logical","commit_stats":{"total_commits":18,"total_committers":9,"mean_commits":2.0,"dds":0.5555555555555556,"last_synced_commit":"fdd3f4585d2c3649eec68738b06e9e8505faabd7"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/csstools/stylelint-use-logical","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fstylelint-use-logical","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fstylelint-use-logical/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fstylelint-use-logical/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fstylelint-use-logical/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csstools","download_url":"https://codeload.github.com/csstools/stylelint-use-logical/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csstools%2Fstylelint-use-logical/sbom","scorecard":{"id":311359,"data":{"date":"2025-08-11","repo":{"name":"github.com/csstools/stylelint-use-logical","commit":"e530fb689673ed72028d2c6faeefe987b47b1345"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":3,"reason":"Found 6/19 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/stylelint-use-logical/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/csstools/stylelint-use-logical/test.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: Creative Commons Zero v1.0 Universal: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T23:13:49.271Z","repository_id":33059702,"created_at":"2025-08-17T23:13:49.271Z","updated_at":"2025-08-17T23:13:49.271Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274194979,"owners_count":25239146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T15:12:51.713Z","updated_at":"2025-09-08T13:38:32.252Z","avatar_url":"https://github.com/csstools.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Property Use Logical [\u003cimg src=\"https://jonathantneal.github.io/stylelint-logo.svg\" alt=\"stylelint\" width=\"90\" height=\"90\" align=\"right\"\u003e][stylelint]\n\n[![NPM Version][npm-img]][npm-url]\n[![Build Status][cli-img]][cli-url]\n[![Support Chat][git-img]][git-url]\n\n[Property Use Logical] is a [stylelint] rule to enforce the usage of\n[Logical Properties and Values] in CSS.\n\nPhysical dimensions and directions are described _left_ to _right_ and _top_ to\n_bottom_, while their logical counterparts are described _start_ to _end_ and\n_inline_ or _block_.\n\n---\n\nFor example, to add spacing before the start of a paragraph, we might use the\nphysical `padding-left` property.\n\n```css\np {\n  padding-left: 2em;\n}\n```\n\nWere the content Hebrew or Arabic — flowing _right to left_ — then we might\nuse alternating `padding-left` and `padding-right` properties.\n\n```css\np:dir(ltr) {\n  padding-left: 2em;\n}\n\np:dir(rtl) {\n  padding-right: 2em;\n}\n```\n\nSelector weight aside, we can instead use the logical `padding-inline-start`\nproperty.\n\n```css\np {\n  padding-inline-start: 2em;\n}\n```\n\nSimilarly, physical _horizontal_ and _vertical_ dimensions are described\nmore succinctly using their logical counterparts.\n\n```css\nh1, h2, h3 {\n  margin-top: 1em;\n  margin-bottom: 1em;\n}\n\nblockquote {\n  margin-left: 1em;\n  margin-right: 1em;\n}\n\n/* becomes */\n\nh1, h2, h3 {\n  margin-block: 1em;\n}\n\nblockquote {\n  margin-inline: 1em;\n}\n```\n\n## Usage\n\nAdd [stylelint] and [Property Use Logical] to your project.\n\n```bash\nnpm install stylelint stylelint-use-logical --save-dev\n```\n\nAdd [Property Use Logical] to your [stylelint configuration].\n\n```js\n{\n  \"plugins\": [\n    \"stylelint-use-logical\"\n  ],\n  \"rules\": {\n    \"csstools/use-logical\": (\"always\" || true) || (\"ignore\" || false || null)\n  }\n}\n```\n\n## Options\n\n### always\n\nThe `\"always\"` option (alternatively `true`) requires logical properties and\nvalues to be used, and the following patterns are _not_ considered violations:\n\n```pcss\n.inset {\n  inset: 0;\n}\n\n.margin {\n  margin-inline-start: 0;\n}\n\n.padding {\n  padding-inline: 0;\n}\n\n.float {\n  float: inline-start;\n}\n\n.text-align {\n  text-align: start;\n}\n\n.text-align-ignored:dir(ltr) {\n  text-align: left;\n}\n```\n\nWhile the following patterns _are_ considered violations:\n\n```pcss\n.inset {\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n}\n\n.margin {\n  margin-left: 0;\n}\n\n.padding {\n  padding-left: 0;\n  padding-right: 0;\n}\n\n.float {\n  float: left;\n}\n\n.text-align {\n  text-align: left;\n}\n```\n\n### ignore\n\nThe `\"ignore\"` option (alternatively `false` or `null`) disables the rule.\n\n## Secondary Options\n\n### except\n\nThe `except` option ignores reporting or autofixing properties and values\nmatching a case-insensitive string or regular expression.\n\n```js\n{\n  \"rules\": {\n    \"csstools/use-logical\": [\"always\", { \"except\": ['float', /^margin/i] }]\n  }\n}\n```\n\n### direction\n\nThe `direction` option controls whether _left to right_ or _right to left_\nproperties and values should be reported or autofixed.\n\n```js\n{\n  \"rules\": {\n    \"csstools/use-logical\": [\"always\", { \"direction\": \"ltr\" || \"rtl\" }]\n  }\n}\n```\n\n## Property and Value Mapping\n\nAssuming _left to right_ directionality:\n\n| Physical Property | Logical Property       |\n| ----------------- | ---------------------- |\n| `top`             | `inset-block-start`    |\n| `right`           | `inset-inline-end`     |\n| `bottom`          | `inset-block-end`      |\n| `left`            | `inset-inline-start`   |\n\n| Physical Property | Logical Property       |\n| ----------------- | ---------------------- |\n| `margin-top`      | `margin-block-start`   |\n| `margin-right`    | `margin-inline-end`    |\n| `margin-bottom`   | `margin-block-end`     |\n| `margin-left`     | `margin-inline-start`  |\n\n| Physical Property | Logical Property       |\n| ----------------- | ---------------------- |\n| `padding-top`     | `padding-block-start`  |\n| `padding-right`   | `padding-inline-end`   |\n| `padding-bottom`  | `padding-block-end`    |\n| `padding-left`    | `padding-inline-start` |\n\n| Physical Property | Logical Property       |\n| ----------------- | ---------------------- |\n| `width`           | `inline-size`          |\n| `min-width`       | `min-inline-size`      |\n| `max-width`       | `max-inline-size`      |\n| `height`          | `block-size`           |\n| `min-height`      | `min-block-size`       |\n| `max-height`      | `max-block-size`       |\n\n| Physical Property           | Logical Property            |\n| --------------------------- | --------------------------- |\n| `border-top-left-radius`    | `border-start-start-radius` |\n| `border-top-right-radius`   | `border-start-end-radius`   |\n| `border-bottom-left-radius` | `border-end-start-radius`   |\n| `border-bottom-right-radius`| `border-end-end-radius`     |\n\n| Physical Value       | Logical Value         |\n| -------------------- | --------------------- |\n| `text-align: left;`  | `text-align: start;`  |\n| `text-align: right;` | `text-align: end;`    |\n\n[cli-img]: https://img.shields.io/travis/csstools/stylelint-use-logical.svg\n[cli-url]: https://travis-ci.org/csstools/stylelint-use-logical\n[git-img]: https://img.shields.io/badge/support-chat-blue.svg\n[git-url]: https://gitter.im/stylelint/stylelint\n[npm-img]: https://img.shields.io/npm/v/stylelint-use-logical.svg\n[npm-url]: https://www.npmjs.com/package/stylelint-use-logical\n\n[Logical Properties and Values]: https://www.w3.org/TR/css-logical-1/\n[stylelint]: https://github.com/stylelint/stylelint\n[stylelint configuration]: https://github.com/stylelint/stylelint/blob/master/docs/user-guide/configuration.md#readme\n[Property Use Logical]: https://github.com/csstools/stylelint-use-logical\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fstylelint-use-logical","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsstools%2Fstylelint-use-logical","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsstools%2Fstylelint-use-logical/lists"}