Skip to content

Commit a982a9c

Browse files
committed
format fix
1 parent 1c3bde5 commit a982a9c

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

contributor-docs/migration-from-box.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,44 @@
44

55
The `Box` component is a utility component that provides a convenient way to apply styles to elements and is simply a `div` element by default. However, it can be less performant than using standard HTML elements with CSS Modules. It has now been deprecated.
66

7-
87
### Box using the `sx` prop
98

109
Replace the Box component with a standard HTML element such as `div`.
1110

1211
```jsx
13-
<Box sx={{ p: 3, bg: 'gray.1' }}>
14-
Content here
15-
</Box>
12+
<Box sx={{p: 3, bg: 'gray.1'}}>Content here</Box>
1613
```
1714

1815
```jsx
19-
<div className={classes.example}>
20-
Content here
21-
</div>
16+
<div className={classes.example}>Content here</div>
2217
```
2318

2419
### Box using the `as` prop
2520

2621
If the Box is currently using the `as` prop to render a different HTML element, make sure to use that element instead.
2722

2823
```jsx
29-
<Box as="section" sx={{ p: 3, bg: 'gray.1' }}>
24+
<Box as="section" sx={{p: 3, bg: 'gray.1'}}>
3025
Content here
3126
</Box>
3227
```
3328

3429
```jsx
35-
<section className={classes.example}>
36-
Content here
37-
</section>
30+
<section className={classes.example}>Content here</section>
3831
```
3932

4033
### Box using style attributes
4134

4235
If the Box is using style attributes, you can replace it with a standard HTML element and use CSS Modules to apply the styles.
4336

4437
```jsx
45-
<Box minWidth={200} maxWidth={400} sx={{ p: 3, bg: 'gray.1' }}>
38+
<Box minWidth={200} maxWidth={400} sx={{p: 3, bg: 'gray.1'}}>
4639
Content here
4740
</Box>
4841
```
4942

5043
```jsx
51-
<div className={clsx(classes.example)}>
52-
Content here
53-
</div>
44+
<div className={clsx(classes.example)}>Content here</div>
5445
```
5546

5647
```css
@@ -60,4 +51,4 @@ If the Box is using style attributes, you can replace it with a standard HTML el
6051
min-width: 200px;
6152
max-width: 400px;
6253
}
63-
```
54+
```

0 commit comments

Comments
 (0)