{"_id":"@btmuli/stylelint-plugin-color","_rev":"2-e10bba0c252e01ea257a43f1736ff4ab","name":"@btmuli/stylelint-plugin-color","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@btmuli/stylelint-plugin-color","version":"0.1.0","keywords":["stylelint","stylelint-plugin","stylelint-rule","color"],"author":{"name":"BTMuli","email":"bt-muli@outlook.com"},"license":"MIT","_id":"@btmuli/stylelint-plugin-color@0.1.0","maintainers":[{"name":"btmuli","email":"BT-Muli@outlook.com"}],"homepage":"https://github.com/BTMuli/stylelint-plugin-color","dist":{"shasum":"410cabd1d3e9eb8f1b601efa60e7d99bf51b7c3c","tarball":"https://registry.npmjs.org/@btmuli/stylelint-plugin-color/-/stylelint-plugin-color-0.1.0.tgz","fileCount":4,"integrity":"sha512-XAjqeFQafsr0S5h2XPnPlFFP4zPluMH2nZ7+D7SG6eLQOYdojvmLGiSaBikWFE0OA0wqxcxzhAYSVXN9SDgiig==","signatures":[{"sig":"MEQCIGLevO4c6qpNTxzUKJNr/V9q8CMEk4IrPHyEOFpQgHldAiBM/bn9+BZDz527JXE9mkGzan1+omAZX2/hT/V4b3Q7iA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6930},"main":"dist/index.js","type":"module","exports":"./dist/index.js","gitHead":"2581f6e32c23c361ae961f9c001ffc9a524364bf","private":false,"scripts":{"build":"tsup --clean src/index.ts --format esm --external stylelint","format":"prettier --write .","test:rule":"node --test --import tsx tests/rule.test.js","test:color":"node --test --import tsx tests/color.test.js"},"_npmUser":{"name":"btmuli","email":"BT-Muli@outlook.com"},"_npmVersion":"10.9.2","description":"A stylelint plugin to enforce color formats","directories":{},"lint-staged":{"*.{js,ts,json}":["prettier --write"]},"_nodeVersion":"23.11.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.11.0","devDependencies":{"tsx":"^4.19.4","tsup":"^8.5.0","husky":"^9.1.7","prettier":"^3.5.3","stylelint":"^16.19.1","@types/node":"^22.15.19","lint-staged":"^16.0.0","stylelint-test-rule-node":"^0.4.0"},"_npmOperationalInternal":{"tmp":"tmp/stylelint-plugin-color_0.1.0_1747741002435_0.4885734136988047","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@btmuli/stylelint-plugin-color","version":"0.2.0","private":false,"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"packageManager":"pnpm@11.20.0","author":{"name":"BTMuli","email":"bt-muli@outlook.com"},"description":"A stylelint plugin to enforce color formats","homepage":"https://github.com/BTMuli/stylelint-plugin-color","repository":{"type":"git","url":"git+https://github.com/BTMuli/stylelint-plugin-color.git"},"type":"module","main":"dist/index.js","exports":"./dist/index.js","license":"MIT","scripts":{"test:color":"node --test --import tsx tests/color.test.js","test:rule":"node --test --import tsx tests/rule.test.js","build":"tsup --clean src/index.ts --format esm --external stylelint","format":"prettier --write ."},"lint-staged":{"*.{js,ts,json}":["prettier --write"]},"keywords":["stylelint","stylelint-plugin","stylelint-rule","color"],"devDependencies":{"@types/color-name":"^2.0.0","@types/node":"^26.2.0","husky":"^9.1.7","lint-staged":"^17.3.0","prettier":"^3.9.6","stylelint":"^17.14.1","stylelint-test-rule-node":"^1.2.0","tsup":"^8.5.1","tsx":"^4.23.11"},"dependencies":{"color-name":"^2.1.1","colord":"^2.9.3"},"gitHead":"2ea8ee1ab1f2892cd3ed65a9a5b762d702cee6ec","_id":"@btmuli/stylelint-plugin-color@0.2.0","bugs":{"url":"https://github.com/BTMuli/stylelint-plugin-color/issues"},"_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-iPqlhpfd96OQwzqt+q0vVIVTQ/4zdCBEuL9BqtLUK/EHaagunySBExSBRyy1FQm0JfWMWs3rPIjqhkRboZp9uQ==","shasum":"383d5a23c89ad372e1a6593812bf55763fde6698","tarball":"https://registry.npmjs.org/@btmuli/stylelint-plugin-color/-/stylelint-plugin-color-0.2.0.tgz","fileCount":4,"unpackedSize":10577,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@btmuli%2fstylelint-plugin-color@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC4P9mVKwaPxHshLgBah1PZyInRk7/xVQHuYgpwGgiJTAiBdQUISRIwHCrxxVazJmuDWRzKCFrurRFDtC1Euwx5ncg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:f9967bb4-ff6c-41b1-9645-24b42fa58b3a"}},"directories":{},"maintainers":[{"name":"btmuli","email":"BT-Muli@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stylelint-plugin-color_0.2.0_1786287744124_0.7259271249711583"},"_hasShrinkwrap":false}},"time":{"created":"2025-05-20T11:36:42.369Z","modified":"2026-08-09T15:02:24.591Z","0.1.0":"2025-05-20T11:36:42.594Z","0.2.0":"2026-08-09T15:02:24.272Z"},"author":{"name":"BTMuli","email":"bt-muli@outlook.com"},"license":"MIT","homepage":"https://github.com/BTMuli/stylelint-plugin-color","keywords":["stylelint","stylelint-plugin","stylelint-rule","color"],"description":"A stylelint plugin to enforce color formats","maintainers":[{"name":"btmuli","email":"BT-Muli@outlook.com"}],"readme":"---\nAuthor: 目棃\nDescription: 说明文档\nDate: 2025-05-15\nUpdate: 2026-08-09\n---\n\n> 本文档 [`Frontmatter`](https://github.com/BTMuli/MuCli#Frontmatter) 由 [MuCli](https://github.com/BTMuli/Mucli) 自动生成于 `2025-05-15 17:54:12`\n>\n> 更新于 `2026-08-09 22:21:07`\n\n# Stylelint-Plugin-Color\n\nStylelint 插件，用于指定项目的颜色格式，**WIP**。\n\n- [x] 支持 `hex`、`hexa`、`rgb`、`rgba` 格式校验\n- [x] 支持 `stylelint --fix` 自动修复\n- [x] 支持忽略命名颜色与动态颜色\n\n## 安装\n\n参考 [BTMuli/TeyvatGuide@f75f982d](https://github.com/BTMuli/TeyvatGuide/commit/f75f982d84787920cb2234f79e4e9baee8beb1c6)\n\n```bash\npnpm i @btmuli/stylelint-plugin-color -D\n```\n\n## 配置说明\n\n```yaml\nplugins:\n  - \"@btmuli/stylelint-plugin-color\"\nrules:\n  color/format:\n    - true\n    - format: hexa\n      ignore:\n        - named-color\n```\n\n- `format`: 颜色格式，为以下之一：\n  - `hex`: 十六进制格式\n  - `hexa`: 十六进制格式（带透明度）\n  - `rgb`: RGB 格式\n  - `rgba`: RGBA 格式\n- `ignore`: 忽略项列表，目前支持：\n  - `named-color`: 忽略 `color: white` 这类命名颜色\n\n也可以只传格式字符串（默认不忽略命名颜色）：\n\n```yaml\nrules:\n  color/format:\n    - true\n    - hexa\n```\n\n## 自动修复\n\n支持 `stylelint --fix` 自动修复，将颜色转换为目标格式，例如：\n\n```css\n/* 修复前 */\n.class {\n  color: #000;\n  color: white;\n}\n\n/* 修复后（目标格式 hexa） */\n.class {\n  color: #000000ff;\n  color: #ffffffff;\n}\n```\n\n带透明度的颜色无法无损转换为 `hex`/`rgb` 时不会被自动修改，会保留告警等待手动处理。\n\n## 参考\n\n- [stylelint-color-format](https://github.com/filipekiss/stylelint-color-format)\n- [stylelint-order](https://github.com/hudochenkov/stylelint-order)\n\n## LICENSE\n\n本项目采用 [MIT](./LICENSE) 许可协议。\n","readmeFilename":"README.md","repository":{"type":"git","url":"git+https://github.com/BTMuli/stylelint-plugin-color.git"},"bugs":{"url":"https://github.com/BTMuli/stylelint-plugin-color/issues"}}