Skip to content

Commit d36a104

Browse files
authored
Merge pull request #821 from dburles/minor-docs-updates
Add ColorKeys component to docs
2 parents 026002c + 8c9ff9f commit d36a104

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
| Key | Description |
2+
| ------------ | --------------------------------------------------------------------------------------------------------------- |
3+
| `text` | Body foreground color |
4+
| `background` | Body background color |
5+
| `primary` | Primary brand color for links, buttons, etc. |
6+
| `secondary` | A secondary brand color for alternative styling |
7+
| `accent` | A contrast color for emphasizing UI |
8+
| `highlight` | A background color for highlighting text |
9+
| `muted` | A faint color for backgrounds, borders, and accents that do not require high contrast with the background color |

packages/docs/src/pages/theme-spec.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Theme Spec
33
---
44

55
import ThemeScales from '../components/theme-scales'
6+
import ColorKeys from '../components/color-keys'
67

78
# Theme Specification
89

@@ -36,7 +37,7 @@ A theme does not require that all these fields be present and can include additi
3637
primary: '#07c',
3738
secondary: '#05a',
3839
accent: '#609',
39-
muted: '#f6f6f6f',
40+
muted: '#f6f6f6',
4041
},
4142
fonts: {
4243
body: 'system-ui, sans-serif',
@@ -59,14 +60,7 @@ A theme does not require that all these fields be present and can include additi
5960

6061
The `theme.colors` scale (i.e. color palette) should be an object literal with the following keys.
6162

62-
| Key | Description |
63-
| ------------ | --------------------------------------------------------------------------------------------------------------- |
64-
| `text` | Body foreground color |
65-
| `background` | Body background color |
66-
| `primary` | Primary brand color for links, buttons, etc. |
67-
| `secondary` | A secondary brand color for alternative styling |
68-
| `accent` | A contrast color for emphasizing UI |
69-
| `muted` | A faint color for backgrounds, borders, and accents that do not require high contrast with the background color |
63+
<ColorKeys />
7064

7165
Other color keys can be added, including raw color values for aliasing the values above.
7266

packages/docs/src/pages/theming.mdx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
title: Theming
33
---
44

5+
import ColorKeys from '../components/color-keys'
6+
57
# Theming
68

79
Theming with Theme UI is based on a [Theme Specification][] including a `theme.styles` object for styling MDX elements and other components.
@@ -14,15 +16,7 @@ By adhering to a standard Theme Specification, Theme UI is designed to be intero
1416
Add a `theme.colors` object to provide colors for a theme.
1517
In order to ensure color palettes are as interoperable as possible, the following color keys should be used for defining a base set of colors:
1618

17-
| Key | Description |
18-
| ------------ | ----------------------------------------------- |
19-
| `text` | body color |
20-
| `background` | body background color |
21-
| `primary` | primary button and link color |
22-
| `secondary` | secondary color - can be used for hover states |
23-
| `accent` | a contrast color for emphasizing UI |
24-
| `highlight` | a background color for highlighting text
25-
| `muted` | a gray or subdued color for decorative purposes |
19+
<ColorKeys />
2620

2721
Beyond these base colors, any additional values can be added to a theme to augment the base color palette.
2822

0 commit comments

Comments
 (0)