Skip to content

Commit cf47272

Browse files
authored
develop: update styled order (#11404)
1 parent 6a29c54 commit cf47272

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

develop-docs/frontend/using-styled-components.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,21 @@ The best styles are the ones you don’t write - whenever possible use existing
99

1010
## Basics
1111

12-
To use Style Components pull in `styled` and apply your CSS. For consistent spacing you should also use `space()`:
12+
To use Style Components, import `styled` from `@emotion/styled` and apply custom CSS. For consistent spacing you should also use `space()`:
1313

1414
```tsx
1515
import styled from '@emotion/styled';
1616
import {space} from 'sentry/styles/space';
1717

18+
export default ExampleComponent() {
19+
return (
20+
<SideBySide>
21+
<p>a number: <Numeric>1</Numeric></p>
22+
<p>and another: <Numeric>2</Numeric></p>
23+
</SideBySide>
24+
)
25+
}
26+
1827
const Numeric = styled('span')`
1928
font-variant-numeric: tabular-nums;
2029
`;
@@ -26,14 +35,6 @@ const SideBySide = styled('div')`
2635
align-items: flex-start;
2736
`;
2837

29-
export default ExampleComponent() {
30-
return (
31-
<SideBySide>
32-
<p>a number: <Numeric>1</Numeric></p>
33-
<p>and another: <Numeric>2</Numeric></p>
34-
</SideBySide>
35-
)
36-
}
3738
```
3839

3940
## Theme

0 commit comments

Comments
 (0)