Skip to content

Commit

Permalink
refactor: Add scrollbar semantic tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
gorzelinski committed Jan 4, 2025
1 parent 027e69d commit d9eed5e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion design-system/sections/section/section.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const section = cva({
bleed: {
marginX: {
base: 'calc(-50vw + 100% / 2)',
xl: 'calc((-50vw + 100% / 2) + token(spacing.s))'
xl: 'calc((-50vw + 100% / 2) + token(sizes.scrollbar.width) / 2)'
},
paddingX: 'm',
...verticalRhythm.paddingY.m,
Expand Down
4 changes: 2 additions & 2 deletions theme/global-styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export const globalCss = defineGlobalStyles({
color: 'primary.300'
},
'::-webkit-scrollbar': {
width: 'token(spacing.m)',
width: 'scrollbar.width',
backgroundColor: 'gray.700',
cursor: 'pointer',
'&:horizontal': {
borderRadius: 'xs',
height: 'token(spacing.s)'
height: 'scrollbar.height'
}
},
'::-webkit-scrollbar-thumb': {
Expand Down
8 changes: 8 additions & 0 deletions theme/semantic-tokens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,14 @@ export const semanticTokens = defineSemanticTokens({
sizes: {
lineLength: {
value: '800px'
},
scrollbar: {
width: {
value: '{spacing.m}'
},
height: {
value: '{spacing.s}'
}
}
},
spacing: {
Expand Down

0 comments on commit d9eed5e

Please sign in to comment.