Được TopGit lập chỉ mục từ metadata GitHub: primer/primitives có 417 sao, viết chủ yếu bằng TypeScript. Color, typography, and spacing primitives in json.
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Note: Motion CSS imports are required for components with animations, such as Spinner from @primer/react. If you're experiencing issues with animated components appearing static, ensure you've imported the motion CSS files.
Note: Spacing tokens provide a unified semantic scale for gap, padding, and margin. Import functional/spacing/space.css to use --space-* tokens in your components.
Design token data
Design token data is stored in the src/tokens directory. These tokens are compiled with style dictionary in scripts/buildTokens.ts.
To make working with tokens easier, we added some additional functionality on top of what style dictionary comes with:
Extending and Overwriting
We have two main color modes: light and dark. Additionally we have specific accessibility modes based on those, such as light high contrast.
We added a way to create a mode by only including the changes from the main mode. We call this overrides.
Overrides are created in src/tokens/functional/color/[light|dark]/overrides/ and have to be added to themes.config.ts to work.
In the individual files, e.g. light.high-contrast.json5 you can now add tokens in the same structure as in any main file, e.g. primitives-light.json5 to replace them.
Transforming Colors with Alpha and Mix
Alpha
You can create color tokens that inherit a color but have a different alpha value by adding the alpha property.
Note: The original alpha value will be replaced by your value. If you add alpha: 0.4 to a color, it doesn't matter if the color you reference has no alpha or alpha: 0.7, the new token will always have newly the defined value of alpha: 0.4.
{
muted: {
$value: '{base.color.blue.3}',
alpha: 0.4, // the opacity value of the color === 40% opaque
$type: 'color',
},
}
Extensions property
According to the w3c design token specs, the $extensions property is used for additional meta data.
For our Figma export we use the following meta data:
collection the collection that the token is added to within Figma
mode the mode that the token is added to within the collection in Figma
scopes the scopes that are assigned to the token in Figma, the actual Figma compatible scopes are retrieved from an object in the figmaAttributes transformer
Token names have to be in camelCase or kebab-case and may only include letters, numbers and -. This is enforced by the token validation (npm run lint:tokens).
The only exception is the @-hack. This is used when you want to have a default value and sub-values, e.g. bgColor.accent and bgColor.accent.muted.
In this case you can create the following structure. The @ will be removed from the name and act as the default value.
primer/primitives có 417 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/primer/primitives. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
primer/primitives có những chủ đề gì?
GitHub topics của primer/primitives: "design-system", "design-tokens", "style-dictionary". TopGit xếp repo vào nhóm UI / UX.
primer/primitives còn đang phát triển không?
Commit gần nhất trên primer/primitives là 14 ngày trước (theo timestamp GitHub). Repo có 67 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
primer/primitives là gì?
primer/primitives (primer/primitives) là dự án TypeScript trên GitHub. Theo mô tả gốc: Color, typography, and spacing primitives in json.
primer/primitives so với các dự án UI / UX khác thế nào?
primer/primitives được TopGit xếp vào nhóm UI / UX, với 417 sao GitHub và viết bằng TypeScript. Xem trang chủ đề UI / UX trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
primer/primitives viết bằng ngôn ngữ gì?
primer/primitives chủ yếu viết bằng TypeScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Vì sao primer/primitives được xếp vào nhóm UI / UX?
TopGit xếp primer/primitives vào nhóm UI / UX dựa trên GitHub topics và mô tả của repo (gắn thẻ: "design-system", "design-tokens", "style-dictionary"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc primitives có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về primitives.