Skip to content

Commit fa53759

Browse files
polish
1 parent 0b0670c commit fa53759

File tree

3 files changed

+27
-18
lines changed

3 files changed

+27
-18
lines changed

docs/src/pages/system/basics/Demo.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Demo() {
2020
<Img
2121
sx={{ width: '100%', maxWidth: { xs: 350, md: 250 } }}
2222
alt="The house from the offer."
23-
src="https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=400&dpr=2"
23+
src="https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&w=400&dpr=2"
2424
/>
2525
<Box
2626
sx={{

docs/src/pages/system/basics/Demo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function Demo() {
2020
<Img
2121
sx={{ width: '100%', maxWidth: { xs: 350, md: 250 } }}
2222
alt="The house from the offer."
23-
src="https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=400&dpr=2"
23+
src="https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&w=400&dpr=2"
2424
/>
2525
<Box
2626
sx={{

docs/src/pages/system/basics/basics.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ The system provide direct access to the value in the theme. It makes it easier t
132132

133133
## The `sx` prop
134134

135-
The sx prop, as part of the system, solves these problems by providing a simple way of applying the correct design tokens for specific CSS properties directly to a React element. The [demo above](#demo) shows how it can be used in Material-UI components.
135+
The `sx` prop, as part of the system, solves these problems by providing a simple way of applying the correct design tokens for specific CSS properties directly to a React element. The [demo above](#demo) shows how it can be used in Material-UI components.
136136

137137
This prop provides a superset of CSS that maps values directly from the theme, depending on the CSS property used. In addition, it allows a simple way of defining responsive values that correspond to the breakpoints defined in the theme.
138138

@@ -162,41 +162,50 @@ There are lots of shorthands available for the CSS properties. Here are few exam
162162
>
163163
```
164164

165-
These are documented in the following sections.
165+
These are documented in the following sections, for instance, [the spacing](/system/spacing/).
166166

167167
### Superset of CSS
168168

169169
As the prop supports a superset of CSS, you can use child or pseudo selectors, media queries, raw CSS values etc. Here are few examples:
170170

171-
```jsx
172-
// Using pseudo selectors
171+
- Using pseudo selectors:
172+
173+
```jsx
173174
<Box
174175
sx={{
175176
// some styles
176177
":hover": {
177-
'& .ChildSelector': {
178-
bgcolor: `${props.color}.dark`,
179-
},
180-
'& .OtherChildSelector': {
181-
color: `${props.color}.dark`,
182-
},
183178
boxShadow: 6,
184179
},
185180
}}
186181
>
187-
```
182+
```
188183

189-
```jsx
190-
// Using media queries
184+
- Using media queries:
185+
186+
```jsx
191187
<Box
192188
sx={{
193189
// some styles
194-
"@media screen and (max-width: 992px)": {
190+
'@media print': {
195191
width: 300,
196192
},
197193
}}
198194
>
199-
```
195+
```
196+
197+
- Using nested selector:
198+
199+
```jsx
200+
<Box
201+
sx={{
202+
// some styles
203+
'& .ChildSelector': {
204+
bgcolor: 'primary.main',
205+
},
206+
}}
207+
>
208+
```
200209

201210
### Responsive values
202211

@@ -301,7 +310,7 @@ const Div = styled('div')``;
301310
>
302311
> You should use this prop whenever you need to add or override a component style. If you find you are repeatedly applying the same styles to a component, then `styled()` may be a better option, as it allows you to specify the styles only once, and reuse them in all component instances. See [Customizing components](/customization/components/) for all the alternatives.
303312
304-
### 4. Babel plugin
313+
### 4. Any element with the babel plugin
305314

306315
TODO [#23220](https://github.com/mui-org/material-ui/issues/23220).
307316

0 commit comments

Comments
 (0)