Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

develop: update styled order #11404

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions develop-docs/frontend/using-styled-components.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,21 @@ The best styles are the ones you don’t write - whenever possible use existing

## Basics

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

```tsx
import styled from '@emotion/styled';
import {space} from 'sentry/styles/space';

export default ExampleComponent() {
return (
<SideBySide>
<p>a number: <Numeric>1</Numeric></p>
<p>and another: <Numeric>2</Numeric></p>
</SideBySide>
)
}

const Numeric = styled('span')`
font-variant-numeric: tabular-nums;
`;
Expand All @@ -26,14 +35,6 @@ const SideBySide = styled('div')`
align-items: flex-start;
`;

export default ExampleComponent() {
return (
<SideBySide>
<p>a number: <Numeric>1</Numeric></p>
<p>and another: <Numeric>2</Numeric></p>
</SideBySide>
)
}
```

## Theme
Expand Down
Loading