{"id":24714052,"url":"https://github.com/ericvera/unocss-preset-strict-design","last_synced_at":"2026-02-27T05:06:04.897Z","repository":{"id":272954100,"uuid":"918277683","full_name":"ericvera/unocss-preset-strict-design","owner":"ericvera","description":"A strict design system preset for UnoCSS","archived":false,"fork":false,"pushed_at":"2025-04-29T00:07:47.000Z","size":1269,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-09T12:32:02.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/ericvera.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-17T15:52:17.000Z","updated_at":"2025-04-29T00:07:45.000Z","dependencies_parsed_at":"2025-01-17T17:24:28.961Z","dependency_job_id":"242f7dc3-809f-4c74-a177-30e0dc2be3e4","html_url":"https://github.com/ericvera/unocss-preset-strict-design","commit_stats":null,"previous_names":["ericvera/unocss-preset-strict-design"],"tags_count":13,"template":false,"template_full_name":"ericvera/ts-lib-template","purl":"pkg:github/ericvera/unocss-preset-strict-design","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Funocss-preset-strict-design","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Funocss-preset-strict-design/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Funocss-preset-strict-design/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Funocss-preset-strict-design/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericvera","download_url":"https://codeload.github.com/ericvera/unocss-preset-strict-design/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericvera%2Funocss-preset-strict-design/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29885801,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"online","status_checked_at":"2026-02-27T02:00:06.759Z","response_time":57,"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":"2025-01-27T08:14:40.287Z","updated_at":"2026-02-27T05:06:04.874Z","avatar_url":"https://github.com/ericvera.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnoCSS Strict Design Preset\n\n**A strict design system preset for [UnoCSS](https://github.com/unocss/unocss).**\n\n[![github license](https://img.shields.io/github/license/ericvera/unocss-preset-strict-design.svg?style=flat-square)](https://github.com/ericvera/unocss-preset-strict-design/blob/master/LICENSE)\n[![npm version](https://img.shields.io/npm/v/unocss-preset-strict-design.svg?style=flat-square)](https://npmjs.org/package/unocss-preset-strict-design)\n\n## Features\n\n- 🎨 Enforces usage of theme values for colors, spacing, font sizes, and more\n- 🚫 Blocks arbitrary values (e.g., `text-[20px]`, `m-[10px]`)\n- ✨ Ensures consistent class naming conventions\n- 🎯 Perfect for maintaining design system consistency\n\n## Design Philosophy\n\nThis preset is built on the principle that consistent design systems lead to better user experiences and more maintainable codebases. Key principles include:\n\n1. **Intentional Constraints**: By limiting to predefined theme values, we ensure design consistency across your entire application.\n\n2. **No Magic Numbers**: Arbitrary values often lead to design inconsistencies. All values should come from your theme configuration.\n\n3. **Predictable Patterns**: Class names follow consistent patterns, making your code more readable and maintainable.\n\n4. **Design System First**: Forces teams to think in terms of design systems rather than one-off solutions.\n\n## Installation\n\n```bash\n# Using npm\nnpm install -D unocss-preset-strict-design\n\n# Using yarn\nyarn add -D unocss-preset-strict-design\n\n# Using pnpm\npnpm add -D unocss-preset-strict-design\n```\n\n## Usage\n\nAdd the preset to your UnoCSS configuration:\n\n```ts\n// uno.config.ts\nimport { defineConfig } from 'unocss'\nimport { presetStrictDesign } from 'unocss-preset-strict-design'\n\nexport default defineConfig({\n  presets: [\n    presetStrictDesign({\n      theme: {\n        colors: {\n          // Your color palette\n          primary: '#0066cc',\n          // ...\n        },\n        spacing: {\n          // Your spacing scale\n          '1': '0.25rem',\n          // ...\n        },\n        fontSize: {\n          // Your font sizes\n          sm: '0.875rem',\n          // ...\n        },\n        fontWeight: {\n          // Your font weights\n          normal: '400',\n          // ...\n        },\n        opacity: {\n          // Your opacity values\n          '50': '0.5',\n          // ...\n        },\n      },\n    }),\n  ],\n})\n```\n\n### Theme Value Inheritance\n\nFor convenience, if not explicitly defined, the following theme properties will automatically inherit values from `theme.spacing`:\n\n- `width`\n- `height`\n- `maxWidth`\n- `maxHeight`\n- `minWidth`\n- `minHeight`\n\nThis means you can use your spacing scale values for these properties without additional configuration.\n\n## Restrictions\n\nThis preset enforces several restrictions to maintain design consistency:\n\n1. **Theme Values Only**: All properties must use predefined theme values\n\n   - ❌ `text-[20px]`, `m-[10px]`, `bg-[#fff]`\n   - ✅ `text-sm`, `m-4`, `bg-primary`\n\n2. **Consistent Class Names**: Enforces consistent naming conventions\n\n   - ❌ `color-red`, `fw-bold`\n   - ✅ `text-red`, `font-bold`\n\n3. **Required Theme Properties**: The theme configuration must include:\n   - `colors`\n   - `spacing`\n   - `fontSize`\n   - `fontWeight`\n   - `opacity`\n\n## Available Utility Classes\n\nThis preset provides the following utility classes:\n\n### Mask Size\n\n- `mask-size-{size}`: Sets the mask size using your theme's spacing values\n  - Example: `mask-size-4` will use the spacing value defined at `theme.spacing['4']`\n  - Only uses predefined spacing values from your theme\n\n### Opacity\n\n- `opacity-{value}`: Sets the opacity using your theme's opacity values\n  - Example: `opacity-50` will use the opacity value defined at `theme.opacity['50']`\n  - Only uses predefined opacity values from your theme\n  - This overrides the opacity rule in the wind preset that allows for arbitrary opacity values\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvera%2Funocss-preset-strict-design","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericvera%2Funocss-preset-strict-design","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericvera%2Funocss-preset-strict-design/lists"}