-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Design System] - Finish initial base token specification #5427
Changes from 13 commits
0423437
500d2ef
bccaeac
13ff2c2
6913e56
785cc45
62c579b
4d1d7f2
dd3c255
722afa1
6de2008
818eafc
00a5472
03d8f2b
acb37a6
a0d1b00
bf4cc54
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
export const BORDER_WIDTH_TOKENS = defineTokens.borderWidths({ | ||
'0': { | ||
value: '0', | ||
type: 'borderWidth', | ||
}, | ||
'100': { | ||
value: '1px', | ||
type: 'borderWidth', | ||
}, | ||
'200': { | ||
value: '2px', | ||
type: 'borderWidth', | ||
}, | ||
}); | ||
|
||
export const BORDER_TOKENS = defineTokens.borders({ | ||
none: { | ||
value: 'none', | ||
type: 'border', | ||
}, | ||
solid: { | ||
value: '{borderWidths.100} solid', | ||
type: 'border', | ||
}, | ||
double: { | ||
value: '{borderWidths.200} solid', | ||
type: 'border', | ||
}, | ||
dashed: { | ||
value: '{borderWidths.100} dashed', | ||
type: 'border', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
import { defineSemanticTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* @deprecated | ||
*/ | ||
export const GRADIENT_TOKENS = defineSemanticTokens.gradients({ | ||
vertical: { | ||
value: `linear-gradient(0deg, {colors.legacy.gradientStart} 0%, {colors.legacy.gradientEnd} 100%)`, | ||
type: 'gradient', | ||
}, | ||
horizontal: { | ||
value: `linear-gradient(99deg, {colors.legacy.gradientEnd} 0%, {colors.legacy.gradientStart} 100%)`, | ||
type: 'gradient', | ||
}, | ||
disabled: { | ||
value: { | ||
base: 'linear-gradient(90deg, #F5C4D8 0%, #FFCBC1 100%)', | ||
_dark: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)', | ||
}, | ||
type: 'gradient', | ||
}, | ||
}); | ||
|
||
export const LEGACY_GRADIENT_TOKENS = defineSemanticTokens.gradients({ | ||
vertical: { value: `linear-gradient(0deg, {colors.legacy.gradientStart} 0%, {colors.legacy.gradientEnd} 100%)` }, | ||
horizontal: { value: `linear-gradient(99deg, {colors.legacy.gradientEnd} 0%, {colors.legacy.gradientStart} 100%)` }, | ||
disabled: { value: 'linear-gradient(90deg, #F5C4D8 0%, #FFCBC1 100%)' }, | ||
darkDisabled: { value: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)' }, | ||
darkDisabled: { value: 'linear-gradient(90deg, #58203E 0%, #612E29 100%)', type: 'gradient' }, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* Represents the size of an element. | ||
* | ||
* Used for properties like width and height. | ||
*/ | ||
antonjoel82 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export const OPACITY_TOKENS = defineTokens.opacity({ | ||
'0': { | ||
value: '0', | ||
type: 'opacity', | ||
}, | ||
'40': { | ||
value: '40%', | ||
type: 'opacity', | ||
}, | ||
'80': { | ||
value: '80%', | ||
type: 'opacity', | ||
}, | ||
'100': { | ||
value: '100%', | ||
type: 'opacity', | ||
}, | ||
}); | ||
|
||
/** @deprecated */ | ||
export const LEGACY_OPACITY_TOKENS = defineTokens.radii({ | ||
'20': { | ||
value: '20%', | ||
type: 'opacity', | ||
}, | ||
'50': { | ||
value: '50%', | ||
type: 'opacity', | ||
}, | ||
'60': { | ||
value: '60%', | ||
type: 'opacity', | ||
}, | ||
Comment on lines
+24
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗒 note (non-blocking): These are values that appear periodically throughout web, but I think we should move to only using the values above which offer similar appearance without unnecessary variation |
||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { defineTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* Represents the size of an element. | ||
* | ||
* Used for properties like width and height. | ||
*/ | ||
export const RADIUS_TOKENS = defineTokens.radii({ | ||
'50': { | ||
value: '0.25rem', | ||
type: 'radius', | ||
}, | ||
'75': { | ||
value: '0.375rem', | ||
type: 'radius', | ||
}, | ||
'100': { | ||
value: '0.5rem', | ||
type: 'radius', | ||
}, | ||
'150': { | ||
value: '0.75rem', | ||
type: 'radius', | ||
}, | ||
circle: { | ||
value: '50%', | ||
type: 'radius', | ||
}, | ||
pill: { | ||
value: '9999px', | ||
type: 'radius', | ||
}, | ||
}); | ||
|
||
/** @deprecated */ | ||
export const LEGACY_RADIUS_TOKENS = defineTokens.radii({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗒 note (non-blocking): These line-up with values that are used frequently throughout web |
||
'63': { | ||
value: '5px', | ||
type: 'radius', | ||
}, | ||
'88': { | ||
value: '7px', | ||
type: 'radius', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineSemanticTokens } from '@pandacss/dev'; | ||
|
||
/** @deprecated */ | ||
export const LEGACY_SHADOW_TOKENS = defineSemanticTokens.shadows({ | ||
light: { | ||
value: '0px 5px 15px rgba(38, 68, 128, 0.05)', | ||
}, | ||
medium: { | ||
value: { | ||
base: '0px 5px 15px rgba(122, 133, 153, 0.25)', | ||
_dark: '0px 5px 20px rgba(0, 0, 0, 0.2)', | ||
}, | ||
}, | ||
dark: { | ||
value: '0px 5px 20px rgba(0, 0, 0, 0.2)', | ||
}, | ||
color: { | ||
value: '0px 5px 20px -5px rgba(233, 52, 94, 0.5)', | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { defineSemanticTokens } from '@pandacss/dev'; | ||
|
||
/** | ||
* Specifies the "depth" of UI elements. | ||
* | ||
* Based on the system from ParkUI: | ||
* https://github.com/cschroeter/park-ui/blob/main/plugins/panda/src/theme/tokens/z-index.ts | ||
* It’s similar to the system from MUI as well: https://mui.com/material-ui/customization/z-index/ | ||
*/ | ||
export const Z_INDEX_TOKENS = defineSemanticTokens.zIndex({ | ||
hide: { | ||
value: -1, | ||
type: 'zIndex', | ||
}, | ||
auto: { | ||
value: 'auto', | ||
type: 'zIndex', | ||
}, | ||
base: { | ||
value: 0, | ||
type: 'zIndex', | ||
}, | ||
docked: { | ||
value: 10, | ||
type: 'zIndex', | ||
}, | ||
dropdown: { | ||
value: 1000, | ||
type: 'zIndex', | ||
}, | ||
sticky: { | ||
value: 1100, | ||
type: 'zIndex', | ||
}, | ||
banner: { | ||
value: 1200, | ||
type: 'zIndex', | ||
}, | ||
overlay: { | ||
value: 1300, | ||
type: 'zIndex', | ||
}, | ||
modal: { | ||
value: 1400, | ||
type: 'zIndex', | ||
}, | ||
popover: { | ||
value: 1500, | ||
type: 'zIndex', | ||
}, | ||
skipLink: { | ||
value: 1600, | ||
type: 'zIndex', | ||
}, | ||
toast: { | ||
value: 1700, | ||
type: 'zIndex', | ||
}, | ||
tooltip: { | ||
value: 1800, | ||
type: 'zIndex', | ||
}, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 praise: Great use "meta-extensions" (e.g.
.tokens
) to descriptively name files. This pattern makes it very easy to identify relevant files between the different layers of the design system.