{"id":19565061,"url":"https://github.com/s3rious/palettier","last_synced_at":"2026-03-05T09:31:29.144Z","repository":{"id":57318337,"uuid":"345364331","full_name":"s3rious/palettier","owner":"s3rious","description":"Generate various output formats from a single source of design tokens","archived":false,"fork":false,"pushed_at":"2024-07-17T22:11:36.000Z","size":173,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T03:05:07.146Z","etag":null,"topics":["css","css-variables","custom-properties","declarations","design-tokens","generate","generator","json","palette","scss","stylesheet","transfrom","variables"],"latest_commit_sha":null,"homepage":"https://github.com/s3rious/palettier","language":"TypeScript","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/s3rious.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":"2021-03-07T14:15:26.000Z","updated_at":"2024-07-17T22:11:37.000Z","dependencies_parsed_at":"2024-10-06T22:42:43.866Z","dependency_job_id":"a65a266f-55ac-4ebb-b9ba-40ca81858155","html_url":"https://github.com/s3rious/palettier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/s3rious/palettier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rious%2Fpalettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rious%2Fpalettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rious%2Fpalettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rious%2Fpalettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s3rious","download_url":"https://codeload.github.com/s3rious/palettier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rious%2Fpalettier/sbom","scorecard":{"id":793904,"data":{"date":"2025-08-11","repo":{"name":"github.com/s3rious/palettier","commit":"eabfe8bc918c26cf1e13d4d36a88e69417b1dd79"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/8 approved changesets -- score normalized to 0","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":"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":"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/npm-publish-github-packages.yml:25","Warn: jobLevel 'packages' permission set to 'write': .github/workflows/npm-publish-github-packages.yml:26","Warn: no topLevel permission defined: .github/workflows/npm-publish-github-packages.yml:1","Warn: no topLevel permission defined: .github/workflows/run-tests-on-push.yml:1"],"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":"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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish-github-packages.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/s3rious/palettier/npm-publish-github-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish-github-packages.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/s3rious/palettier/npm-publish-github-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish-github-packages.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/s3rious/palettier/npm-publish-github-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/npm-publish-github-packages.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/s3rious/palettier/npm-publish-github-packages.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-tests-on-push.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/s3rious/palettier/run-tests-on-push.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/run-tests-on-push.yml:10","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   3 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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Warn: 'stale review dismissal' is disabled on branch 'main'","Warn: branch 'main' does not require approvers","Warn: codeowners review is required - but no codeowners file found in repo","Warn: 'last push approval' is disabled on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on 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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 12 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":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3"],"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-23T08:22:41.626Z","repository_id":57318337,"created_at":"2025-08-23T08:22:41.626Z","updated_at":"2025-08-23T08:22:41.626Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30117679,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T08:19:04.902Z","status":"ssl_error","status_checked_at":"2026-03-05T08:17:37.148Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["css","css-variables","custom-properties","declarations","design-tokens","generate","generator","json","palette","scss","stylesheet","transfrom","variables"],"created_at":"2024-11-11T05:24:53.918Z","updated_at":"2026-03-05T09:31:29.103Z","avatar_url":"https://github.com/s3rious.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Palettier\n\n[![CI](https://github.com/s3rious/palettier/actions/workflows/run-tests-on-push.yml/badge.svg)](https://github.com/s3rious/palettier/actions/workflows/run-tests-on-push.yml)\n[![npm version](https://badge.fury.io/js/palettier.svg)](https://badge.fury.io/js/palettier)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nPalettier is a tool designed to generate various output formats from a single source of design tokens.\n\nBasically it transforms this:\n```js\n/* tokens.js */\nconst color = \"rgb(255, 255, 255)\";\n\nconst background = {\n  100: tinycolor(color).toRgbString(),\n  50: tinycolor(color).setAlpha(0.5).toRgbString(),\n  25: tinycolor(color).setAlpha(0.25).toRgbString(),\n};\n\nconst color = {\n  background,\n};\n\nconst tokens = {\n  color,\n};\n\nexport default tokens;\n```\n\nInto this:\n```json\n/* palette.json */\n{\n  \"color\": {\n    \"background\": {\n      \"25\": \"rgba(255, 255, 255, 0.25)\",\n      \"50\": \"rgba(255, 255, 255, 0.5)\",\n      \"100\": \"rgb(255, 255, 255)\"\n    }\n  }\n}\n```\n```css\n/* palette.css */\n:root {\n  --color-background-25: rgba(255, 255, 255, 0.25);\n  --color-background-50: rgba(255, 255, 255, 0.5);\n  --color-background-100: rgb(255, 255, 255);\n}\n```\n\nAnd more!\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Configuration](#configuration)\n- [Transforms](#transforms)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Usage\n\n## Installation\n\nRun Palettier without installation via npx:\n\n```sh\nnpx palettier\n```\n\nInstall Palettier globally using npm:\n\n```sh\nnpm install -g palettier\n```\n\nOr add it to your project as a dev dependency:\n\n```sh\nnpm install --save-dev palettier\n```\n\n## Configuration\n\nThere is two ways to pass the config.\n\nUsing a Config file:\n- `--config`: Path to a JSON or JavaScript configuration file.\n\n```sh\npalettier --config path/to/config.json\n```\n\nExample configuration file:\n```json\n{\n  \"src\": \"path/to/tokens.js\",\n  \"dist\": \"path/to/output\",\n  \"transform\": [\n    [\"json\", \"palette.json\"],\n    [\"cssVariables\", \"palette.module.css\"]\n  ],\n  \"verbose\": true\n}\n```\n\nOr using command-line arguments:\n- `--src`: Source file containing the token definitions.\n- `--dist`: Output directory for the generated files.\n- `--transform`: Transformation definitions in the format `type:filename:options`.\n- `--verbose`: Enable verbose logging.\n- \n```sh\npalettier --src path/to/tokens.js --dist path/to/output --transform json:palette.json --transform cssVariables:palette.module.css --verbose\n```\n\nAlso, if you run Palettier without or with minimal arguments, it uses and extends the default configuration:\n\n```json\n{\n  \"src\": \"./index.js\",\n  \"dist\": \"./\",\n  \"transform\": [\n    [\"json\", \"palette.json\"],\n    [\"cssVariables\", \"palette.module.css\"]\n  ],\n  \"verbose\": false\n}\n```\n\n## Transforms\n\nPalettier supports several built-in transforms:\n\n- `json`: Converts tokens to a JSON file.\n- `cssVariables`: Converts tokens to CSS variables.\n  - Option `className`\n    - Wraps variables with a specified class (default is `:root`).\n- `scss`: Converts tokens to SCSS variables.\n  - Option `className`\n    - Wraps variables with a specified class (default is no class, prints without a wrap).\n- `jsObject`: Converts tokens to a JavaScript object.\n  - Option `jsExportType`:\n    - `default`: Exports as `export default`.\n    - `named`: Exports as `export { palette }` (default, preferred and recommended way).\n    - `commonjs`: Exports as `module.exports`.\n\nYou can also implement custom transforms by creating a function that accepts tokens and returns transformed content:\n```js\n// config.js\nfunction customJsonTransformer(tokens, rootObjectKey, childObjectKey) {\n  return JSON.stringify(\n    {\n      [rootObjectKey]: {\n        [childObjectKey]: tokens,\n      },\n    },\n    null,\n    4,\n  );\n}\n\nexport default {\n  src: \"./tokens/index.js\",\n  dist: \"./out/\",\n  transform: [[customJsonTransformer, \"palette-custom.json\", \"root\", \"child\"]],\n  verbose: true,\n};\n```\n\n## Examples\n\n### Example token file\n\n```js\nconst tokens = {\n  colorPrimary: \"#3498db\",\n  fontSizeBase: \"16px\",\n  spacing: {\n    small: \"8px\",\n    medium: \"16px\",\n    large: \"24px\"\n  }\n};\n\nexport default tokens;\n```\n\n### Example configuration file\n\n```json\n{\n  \"src\": \"tokens.js\",\n  \"dist\": \"dist\",\n  \"transform\": [\n    [\"json\", \"palette.json\"],\n    [\"cssVariables\", \"palette.module.css\"],\n    [\"scss\", \"palette.scss\"],\n    [\"jsObject\", \"palette.js:commonjs\"]\n  ],\n  \"verbose\": true\n}\n```\n\n### More examples\n\nFor more examples, please see the [`examples/` folder of the repo](examples).\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/my-new-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/my-new-feature`).\n5. Create a new pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3rious%2Fpalettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs3rious%2Fpalettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3rious%2Fpalettier/lists"}