mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-27 04:44:30 +00:00
Add the size
token
Introduces the `size` token, a token that will be used for defining standardized sizes for paddings, margins & borders. Available sizes are `px`, `xs`, `sm`, `md`, `lg`, `xl` - Adds `size`, types, and token - Adds the size() function
This commit is contained in:
parent
64ecfcd33f
commit
0cc5a3839d
1 changed files with 27 additions and 0 deletions
|
@ -65,6 +65,32 @@ export const fontWeights = {
|
|||
"black": fontWeight("black"),
|
||||
}
|
||||
|
||||
// Standard size unit used for paddings, margins, borders, etc.
|
||||
export type Size =
|
||||
| "px"
|
||||
| "xs"
|
||||
| "sm"
|
||||
| "md"
|
||||
| "lg"
|
||||
| "xl";
|
||||
|
||||
export const sizes = {
|
||||
px: 1,
|
||||
xs: 2,
|
||||
sm: 4,
|
||||
md: 6,
|
||||
lg: 8,
|
||||
xl: 12,
|
||||
};
|
||||
|
||||
export type SizeToken = Token<Size, "size">;
|
||||
function size(value: Size): SizeToken {
|
||||
return {
|
||||
value,
|
||||
type: "size"
|
||||
};
|
||||
}
|
||||
|
||||
export type Color = string;
|
||||
export interface ColorToken {
|
||||
value: Color,
|
||||
|
@ -104,5 +130,6 @@ export default {
|
|||
fontFamilies,
|
||||
fontSizes,
|
||||
fontWeights,
|
||||
size,
|
||||
colors,
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue