You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2024. It is now read-only.
@@ -17,6 +17,26 @@ you provide array values to add mobile-first responsive styles.
17
17
> We use the `@media(min-width)` media queries to ensure values are
18
18
> mobile-first.
19
19
20
+
Responsive syntax relies on the breakpoints defined in the theme object. Chakra
21
+
UI provides default breakpoints, here's what it looks like:
22
+
23
+
```js
24
+
constbreakpoints= {
25
+
sm:'30em', // 480px upwards
26
+
md:'48em', // 768px upwards
27
+
lg:'62em', // 992px upwards
28
+
xl:'80em', // 1280px upwards
29
+
'2xl':'96em'// 1536px upwards
30
+
}
31
+
```
32
+
33
+
To make styles responsive, you can use either the array or object syntax.
34
+
35
+
## The Array syntax
36
+
37
+
All style props accept arrays as values for mobile-first responsive styles. This
38
+
is the recommended method.
39
+
20
40
```vue
21
41
<template>
22
42
<c-box
@@ -76,28 +96,103 @@ It'll generate a CSS that looks like this
76
96
}
77
97
```
78
98
79
-
80
99
___NOTE___: In the shortcut example `'100%'` is used instead of `1` because in the default Chakra UI Vue theme, `theme.sizes[1] = 0.25rem`. This means that using a prop like `:width="1"` will render a width of 4px and not `'100%'`
81
100
82
-
The equivalent of this style if you passed it as an object.
101
+
To interpret array responsive values, Chakra UI converts the values defined in `theme.breakpoints`
102
+
and sorts them in ascending order. Afterward, we map the
0 commit comments