Skip to content

Commit 1f45332

Browse files
committed
update breakpoint values to match design
1 parent a2cec93 commit 1f45332

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

src/docs/breakpoints/breakpoints.stories.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ Use the `ScreenSize` enum for standard breakpoints.
88

99
```ts
1010
export enum ScreenSize {
11-
sm = 640,
12-
md = 768,
13-
lg = 1024,
14-
xl = 1280,
15-
xxl = 1536,
11+
xs = 600,
12+
sm = 905,
13+
md = 1240,
14+
lg = 1440,
1615
}
1716
```
1817

@@ -23,7 +22,7 @@ import { style } from "@vanilla-extract/css";
2322
export const myStyle = style({
2423
...
2524
"@media": {
26-
...atScreenSizeSm({
25+
...atScreenSizeXs({
2726
justifyContent: "flex-start",
2827
padding: "0px 24px",
2928
}),
@@ -34,7 +33,7 @@ export const myStyle = style({
3433
### In React components:
3534

3635
```ts
37-
const isScreenSmall = useBreakpoint(ScreenSize.sm);
36+
const isScreenSmall = useBreakpoint(ScreenSize.xs);
3837

3938
return (
4039
{isScreenSmall && <></>}

src/tokens/breakpoints.css.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
export enum ScreenSize {
2-
sm = 640,
3-
md = 768,
4-
lg = 1024,
5-
xl = 1280,
6-
xxl = 1536,
2+
xs = 600,
3+
sm = 905,
4+
md = 1240,
5+
lg = 1440,
76
}
87

98
// deprecated, use ScreenSize instead.

src/util/breakpoint-utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,14 @@ export const makeCustomBreakpoint =
2323
[`(max-width: ${breakpoint})`]: { ...styles },
2424
});
2525

26+
export const atScreenSizeXs = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
27+
makeCustomBreakpoint(ScreenSize.xs)(styles);
2628
export const atScreenSizeSm = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
2729
makeCustomBreakpoint(ScreenSize.sm)(styles);
2830
export const atScreenSizeMd = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
2931
makeCustomBreakpoint(ScreenSize.md)(styles);
3032
export const atScreenSizeLg = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
3133
makeCustomBreakpoint(ScreenSize.lg)(styles);
32-
export const atScreenSizeXl = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
33-
makeCustomBreakpoint(ScreenSize.xl)(styles);
34-
export const atScreenSizeXXL = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>
35-
makeCustomBreakpoint(ScreenSize.xxl)(styles);
3634

3735
// below are all deprecated. Prefer `atScreenSizeX` instead.
3836
export const atLargeBreakpoint = (styles: StyleRule): FeatureQueries<StyleWithSelectors> =>

0 commit comments

Comments
 (0)