{"id":15960496,"url":"https://github.com/ealexandros/tailwindcss-root-variables","last_synced_at":"2026-01-25T03:02:17.338Z","repository":{"id":257810171,"uuid":"854116040","full_name":"ealexandros/tailwindcss-root-variables","owner":"ealexandros","description":"🎨 A Tailwind CSS plugin for defining custom CSS variables to use across your stylesheet.","archived":false,"fork":false,"pushed_at":"2024-10-07T08:15:58.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-11T15:08:43.391Z","etag":null,"topics":["css","css-variables","root-variables","tailwind","tailwind-plugin","tailwindcss","tailwindcss-plugin","tailwindcss-variables"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tailwindcss-root-variables","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/ealexandros.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":"2024-09-08T12:55:01.000Z","updated_at":"2024-10-08T15:17:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"95c99b1b-7462-4edc-8678-e7fe5508b7b2","html_url":"https://github.com/ealexandros/tailwindcss-root-variables","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"c50b5491db28afda93343d5a5ce84e4d057b4900"},"previous_names":["ealexandros/tailwindcss-root-variables"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ealexandros/tailwindcss-root-variables","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealexandros%2Ftailwindcss-root-variables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealexandros%2Ftailwindcss-root-variables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealexandros%2Ftailwindcss-root-variables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealexandros%2Ftailwindcss-root-variables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ealexandros","download_url":"https://codeload.github.com/ealexandros/tailwindcss-root-variables/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ealexandros%2Ftailwindcss-root-variables/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28742973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T02:46:29.005Z","status":"ssl_error","status_checked_at":"2026-01-25T02:44:29.968Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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","root-variables","tailwind","tailwind-plugin","tailwindcss","tailwindcss-plugin","tailwindcss-variables"],"created_at":"2024-10-07T15:03:22.130Z","updated_at":"2026-01-25T03:02:17.323Z","avatar_url":"https://github.com/ealexandros.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  🎨 Tailwind CSS Variables Plugin 🎨\n\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Tailwindcss-0F172A?\u0026logo=tailwindcss\" /\u003e\n  \u003cimg src=\"https://shields.io/badge/CSS-0F172A?logo=css3\u0026logoColor=06B6D4\" /\u003e\n  \u003cimg src=\"https://shields.io/badge/TypeScript-0F172A?logo=TypeScript\u0026logoColor=06B6D4\" /\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cp align=\"center\"\u003eThis Tailwind CSS plugin allows you to define custom CSS root variables that can be used throughout your stylesheets. It provides a way to manage and organize CSS variables efficiently using Tailwind's configuration.\u003c/p\u003e\n\n\u003cdiv style=\"padding-top: 0.2em\" /\u003e\n\n## 🚀 Installation\n\nTo use this plugin, you need to install it and add it to your Tailwind CSS configuration.\n\n#### 1. Install the plugin:\n\n```bash\n$ npm install --save-dev tailwindcss-root-variables\n```\n\nYou can find the package on [npm here](https://www.npmjs.com/package/tailwindcss-root-variables).\n\n#### 2. Add the plugin to your Tailwind CSS configuration:\n\n```javascript\n// tailwind.config.js\n\nmodule.exports = {\n  // other configuration...\n  plugins: [require(\"tailwindcss-root-variables\")],\n};\n```\n\n## ⚙️ Configuration\n\nYou can configure the plugin in your `tailwind.config.js` file using the `rootVars` key.\n\n### Configuration Options\n\n\u003ctable\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eOption\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eRequired\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003edefaultPrefix\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eA default prefix for variable names.\u003c/td\u003e\n      \u003ctd\u003eOptional\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003euseDefaultPrefixOnly\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eIf \u003ccode\u003etrue\u003c/code\u003e, only the default prefix will be used, and no group name will be included.\u003c/td\u003e\n      \u003ctd\u003eOptional\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003ccode\u003evars\u003c/code\u003e\u003c/td\u003e\n      \u003ctd\u003eAn object defining your CSS variables.\u003c/td\u003e\n      \u003ctd\u003eOptional\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Example Configuration:\n\n```javascript\n// tailwind.config.js\n\nconst customSpacing = {\n  small: \"4px\",\n  medium: \"8px\",\n  large: \"16px\",\n};\n\nmodule.exports = {\n  rootVars: {\n    defaultPrefix: \"my\",\n    useDefaultPrefixOnly: false,\n    vars: {\n      colors: {\n        primary: \"#ff5733\",\n        secondary: \"#33ff57\",\n      },\n      spacing: customSpacing,\n    },\n  },\n  // additional config...\n};\n```\n\nThis configuration will generate the following CSS variables:\n\n```css\n:root {\n  --my-colors-primary: #ff5733;\n  --my-colors-secondary: #33ff57;\n  --my-spacing-small: 4px;\n  --my-spacing-medium: 8px;\n  --my-spacing-large: 16px;\n}\n```\n\n### Integrating with Typescript\n\nUse the `WithRootVarsType\u003cConfig\u003e` type to type to seamlessly incorporate custom CSS variables into your Tailwind CSS configuration.\n\n```typescript\n// typescript.config.ts\n\nimport type { Config } from \"tailwindcss\";\nimport type { WithRootVarsType } from \"tailwindcss-root-variables\";\n\nconst config: WithRootVarsType\u003cConfig\u003e = {\n  rootVars: {\n    defaultPrefix: \"my\",\n    // additional config...\n  },\n  // additional config...\n};\n\nexport default config;\n```\n\n## 💫️ Usage\n\nAfter configuring the plugin, you can use the generated CSS variables in your stylesheets as you normally would:\n\n```css\n.some-class {\n  color: var(--my-colors-primary);\n  margin: var(--my-spacing-medium);\n}\n```\n\n## 📝 License\n\nThis plugin is licensed under the [MIT License](https://github.com/ealexandros/tailwindcss-root-variables/blob/main/LICENSE).\n\n## 🤝 Contributing\n\nIf you would like to contribute to the development of this plugin, please submit a pull request or open an issue with any suggestions or bugs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fealexandros%2Ftailwindcss-root-variables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fealexandros%2Ftailwindcss-root-variables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fealexandros%2Ftailwindcss-root-variables/lists"}