File tree 3 files changed +12
-16
lines changed 3 files changed +12
-16
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,10 @@ Use the `ScreenSize` enum for standard breakpoints.
8
8
9
9
``` ts
10
10
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 ,
16
15
}
17
16
```
18
17
@@ -23,7 +22,7 @@ import { style } from "@vanilla-extract/css";
23
22
export const myStyle = style ({
24
23
...
25
24
" @media" : {
26
- ... atScreenSizeSm ({
25
+ ... atScreenSizeXs ({
27
26
justifyContent: " flex-start" ,
28
27
padding: " 0px 24px" ,
29
28
}),
@@ -34,7 +33,7 @@ export const myStyle = style({
34
33
### In React components:
35
34
36
35
``` ts
37
- const isScreenSmall = useBreakpoint (ScreenSize .sm );
36
+ const isScreenSmall = useBreakpoint (ScreenSize .xs );
38
37
39
38
return (
40
39
{isScreenSmall && <></>}
Original file line number Diff line number Diff line change 1
1
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 ,
7
6
}
8
7
9
8
// deprecated, use ScreenSize instead.
Original file line number Diff line number Diff line change @@ -23,16 +23,14 @@ export const makeCustomBreakpoint =
23
23
[ `(max-width: ${ breakpoint } )` ] : { ...styles } ,
24
24
} ) ;
25
25
26
+ export const atScreenSizeXs = ( styles : StyleRule ) : FeatureQueries < StyleWithSelectors > =>
27
+ makeCustomBreakpoint ( ScreenSize . xs ) ( styles ) ;
26
28
export const atScreenSizeSm = ( styles : StyleRule ) : FeatureQueries < StyleWithSelectors > =>
27
29
makeCustomBreakpoint ( ScreenSize . sm ) ( styles ) ;
28
30
export const atScreenSizeMd = ( styles : StyleRule ) : FeatureQueries < StyleWithSelectors > =>
29
31
makeCustomBreakpoint ( ScreenSize . md ) ( styles ) ;
30
32
export const atScreenSizeLg = ( styles : StyleRule ) : FeatureQueries < StyleWithSelectors > =>
31
33
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 ) ;
36
34
37
35
// below are all deprecated. Prefer `atScreenSizeX` instead.
38
36
export const atLargeBreakpoint = ( styles : StyleRule ) : FeatureQueries < StyleWithSelectors > =>
You can’t perform that action at this time.
0 commit comments