Skip to content

Commit

Permalink
Docs accessibility fixes (#919)
Browse files Browse the repository at this point in the history
* updated Section example to use a background colour with sufficient contrast

* improved styling of torchlight Card example in docs on very small (320px) viewports

* only show a single card in docs torchlight example
  • Loading branch information
joshfarrant authored Feb 13, 2025
1 parent 65f7a92 commit 96b0ad7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
39 changes: 15 additions & 24 deletions apps/docs/content/components/Card/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -148,30 +148,21 @@ The color of the lit area corrosponds to the nearest active, primary accent colo

```jsx live
<ThemeProvider colorMode="dark">
<Box padding="spacious" backgroundColor="default">
<Stack direction="horizontal" padding="none">
<Card href="https://github.com">
<Card.Icon icon={CopilotIcon} color="pink" hasBackground />
<Card.Heading>Code search & code view</Card.Heading>
<Card.Description>
Enables you to rapidly search, navigate, and understand code, right
from GitHub.com.
</Card.Description>
</Card>
<Card
href="https://github.com"
style={{
['--brand-color-accent-primary']: 'var(--base-color-scale-lime-2)',
}}
>
<Card.Icon icon={ZapIcon} color="lime" hasBackground />
<Card.Heading>Code search & code view</Card.Heading>
<Card.Description>
Enables you to rapidly search, navigate, and understand code, right
from GitHub.com.
</Card.Description>
</Card>
</Stack>
<Box backgroundColor="default" padding="condensed">
<Card
href="https://github.com"
fullWidth
style={{
['--brand-color-accent-primary']: 'var(--base-color-scale-lime-2)',
}}
>
<Card.Icon icon={ZapIcon} color="lime" hasBackground />
<Card.Heading>Code search & code view</Card.Heading>
<Card.Description>
Enables you to rapidly search, navigate, and understand code, right from
GitHub.com.
</Card.Description>
</Card>
</Box>
</ThemeProvider>
```
Expand Down
9 changes: 4 additions & 5 deletions apps/docs/content/components/Section/react.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ The default `Section` wraps its content in a semantic `<section>` element and pr
### With custom background color

```jsx live
<Section backgroundColor="#FFF8F8">
<Section backgroundColor="#2AA198">
<SectionIntro align="center">
<SectionIntro.Heading size="3">Custom background</SectionIntro.Heading>
<SectionIntro.Description>
This section uses a custom background color.
</SectionIntro.Description>
<SectionIntro.Heading size="3">
Custom background color
</SectionIntro.Heading>
</SectionIntro>
</Section>
```
Expand Down

0 comments on commit 96b0ad7

Please sign in to comment.