{"id":18652725,"url":"https://github.com/meowtec/stylelint-no-px","last_synced_at":"2025-04-07T18:12:09.189Z","repository":{"id":57373675,"uuid":"97811466","full_name":"meowtec/stylelint-no-px","owner":"meowtec","description":"A stylelint custom rule to ensure using rem instead of px","archived":false,"fork":false,"pushed_at":"2025-03-24T03:33:21.000Z","size":31,"stargazers_count":33,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T17:16:28.520Z","etag":null,"topics":["css","px","rem","stylelint"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/meowtec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-07-20T08:37:15.000Z","updated_at":"2025-03-24T03:33:24.000Z","dependencies_parsed_at":"2024-06-18T16:56:42.971Z","dependency_job_id":null,"html_url":"https://github.com/meowtec/stylelint-no-px","commit_stats":{"total_commits":31,"total_committers":4,"mean_commits":7.75,"dds":"0.25806451612903225","last_synced_commit":"0f86e9736551cff798144d0060e3eaaa69d286b8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowtec%2Fstylelint-no-px","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowtec%2Fstylelint-no-px/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowtec%2Fstylelint-no-px/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/meowtec%2Fstylelint-no-px/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/meowtec","download_url":"https://codeload.github.com/meowtec/stylelint-no-px/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247704571,"owners_count":20982298,"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","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":["css","px","rem","stylelint"],"created_at":"2024-11-07T07:08:12.947Z","updated_at":"2025-04-07T18:12:09.119Z","avatar_url":"https://github.com/meowtec.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stylelint-no-px\n\n![https://travis-ci.org/meowtec/stylelint-no-px](https://travis-ci.org/meowtec/stylelint-no-px.svg?branch=master)\n\nA stylelint custom rule to ensure rem instead of px.\n\nIf you are using `rem` (instead of `px`) as **1px solution** or for other purposes, you should need a stylelint rule to enforce using rem. Thats it.\n\n```less\nwidth: 10px; // error\nborder: 1px solid #eee; // ok\n```\n\n## Installation\n\n```\nnpm install stylelint-no-px --save-dev\n```\n\n## Usage\n\nAdd it to your stylelint config\n\n```javascript\n// .stylelintrc\n{\n  \"plugins\": [\n    \"stylelint-no-px\"\n  ],\n  \"rules\": {\n    // ...\n    \"meowtec/no-px\": [true, { \"ignore\": [\"1px\"] }],\n    // or just:\n    \"meowtec/no-px\": true,\n    // ...\n  }\n}\n```\n\n## Options\n\n### ignore: Item[]\n\nignore value check.\n\nValid value of Item: `propertyName` | `'1px'` | `'${propertyName} 1px'`\n\n### ignoreFunctions: string[]\n\nIgnore check for functions.\n\n### remSize: number\n\nSpecify a base size for converting px to rem. If this option is provided, the plugin will automatically convert pixel values to rem using the provided base size.\n\n### example(1) (the default options)\n\n```javascript\n// all 1px is ok\n\"meowtec/no-px\": [true, { \"ignore\": [\"1px\"] }],\n```\n\n```less\n@padding-base: 20px; // error\n\n.foo {\n  border-top: 1px solid #ccc; // ok\n  padding: 10px; // error\n  height: 1px; // ok\n  padding: @padding-base * 2;\n}\n```\n\n### example(2)\n\n```javascript\n//  - all `1px` or `font` is ok\n//  - rem(Npx) is ok\n\"meowtec/no-px\": [true, { \"ignore\": [\"1px\", \"font\"], \"ignoreFunctions\": [\"rem\"] }],\n```\n\n```less\n.foo {\n  border-top: 1px solid #ccc; // ok\n  height: 1px; // ok\n  font-size: 24px; // ok\n  padding: 10px; // error\n  width: calc(100% - 10px); // error\n  font-size: rem(10px); // ok\n}\n```\n\n### example(3)\n\n```javascript\n// only `border + 1px` is ok\n\"meowtec/no-px\": [true, { \"ignore\": [\"border 1px\"] }],\n```\n\n```less\n.foo {\n  border-top: 1px solid #ccc; // ok\n  height: 1px; // error\n}\n```\n\n### example(4)\n\n```javascript\n// only `border + 1px` is ok\n\"meowtec/no-px\": [true, { \"ignore\": [\"1px\"], \"remSize\": 16 }],\n```\n\n```less\n.foo {\n  height: 16px; // error, auto converts to 1rem\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowtec%2Fstylelint-no-px","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmeowtec%2Fstylelint-no-px","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmeowtec%2Fstylelint-no-px/lists"}