Skip to content

Commit 08318d4

Browse files
authored
ref(scraps): apply sizes (#104432)
Follow-up to #103685. This PR applies our new size tokens to the existing theme object. The values are equivalent, they just are now generated from from the Figma document and exposed in the theme.
1 parent 11fefb6 commit 08318d4

File tree

2 files changed

+4
-68
lines changed

2 files changed

+4
-68
lines changed

static/app/utils/theme/scraps/size.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@ export const space = {
1111
xl: '16px',
1212
'2xl': '24px',
1313
'3xl': '32px',
14-
'4xl': '48px',
15-
'5xl': '64px',
16-
'6xl': '80px',
17-
'7xl': '96px',
18-
'8xl': '112px',
19-
'9xl': '128px',
2014
};
2115

2216
export const size = {
@@ -53,7 +47,8 @@ export const radius = {
5347
full: '999px',
5448
};
5549

56-
export const breakpoint = {
50+
export const breakpoints = {
51+
'2xs': '0px',
5752
xs: '500px',
5853
sm: '800px',
5954
md: '992px',

static/app/utils/theme/theme.tsx

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import modifyColor from 'color';
1414
import {spring, type Transition} from 'framer-motion';
1515

1616
import {color} from 'sentry/utils/theme/scraps/color';
17+
import {breakpoints, radius, size, space} from 'sentry/utils/theme/scraps/size';
1718

1819
type SimpleMotionName = 'smooth' | 'snap' | 'enter' | 'exit';
1920

@@ -424,19 +425,6 @@ type ButtonColors = Record<
424425
}
425426
>;
426427

427-
type Breakpoint = '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
428-
type Breakpoints = Record<Breakpoint, string>;
429-
430-
const breakpoints = {
431-
'2xs': '0px',
432-
xs: '500px',
433-
sm: '800px',
434-
md: '992px',
435-
lg: '1200px',
436-
xl: '1440px',
437-
'2xl': '2560px',
438-
} as const satisfies Breakpoints;
439-
440428
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
441429

442430
// @TODO: this needs to directly reference the icon direction
@@ -494,49 +482,14 @@ const iconSizes: Record<Size, string> = {
494482
'2xl': '72px',
495483
} as const;
496484

497-
const space = {
498-
'0': '0px',
499-
/**
500-
* Equivalent to deprecated `space(0.25)`
501-
*/
502-
'2xs': '2px',
503-
/**
504-
* Equivalent to deprecated `space(0.5)`
505-
*/
506-
xs: '4px',
507-
/**
508-
* Equivalent to deprecated `space(0.75)`
509-
*/
510-
sm: '6px',
511-
/**
512-
* Equivalent to deprecated `space(1)`
513-
*/
514-
md: '8px',
515-
/**
516-
* Equivalent to deprecated `space(1.5)`
517-
*/
518-
lg: '12px',
519-
/**
520-
* Equivalent to deprecated `space(2)`
521-
*/
522-
xl: '16px',
523-
/**
524-
* Equivalent to deprecated `space(3)` (was `20px`)
525-
*/
526-
'2xl': '24px',
527-
/**
528-
* Equivalent to deprecated `space(4)` (was `30px`)
529-
*/
530-
'3xl': '32px',
531-
} as const;
532-
533485
/**
534486
* Values shared between light and dark theme
535487
*/
536488
const commonTheme = {
537489
breakpoints,
538490

539491
space,
492+
size,
540493
motion: generateMotion(),
541494

542495
// Icons
@@ -1170,18 +1123,6 @@ function generateChonkTokens(colorScheme: typeof lightColors) {
11701123
};
11711124
}
11721125

1173-
const radius = {
1174-
'0': '0px',
1175-
'2xs': '2px',
1176-
xs: '3px',
1177-
sm: '4px',
1178-
md: '6px',
1179-
lg: '8px',
1180-
xl: '12px',
1181-
'2xl': '16px',
1182-
full: 'calc(infinity*1px)',
1183-
} as const;
1184-
11851126
const lightColors = {
11861127
black: color.black,
11871128
white: color.white,

0 commit comments

Comments
 (0)