You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/docs/src/pages/theme-spec.mdx
+17-10Lines changed: 17 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,8 @@ import ThemeScales from '../components/theme-scales'
6
6
7
7
# Theme Specification
8
8
9
-
Theme UI is based on the [System UI Theme Specification][], with a few **optional** additions.
10
-
The top-level naming convention used in the `theme` object come from this specification.
11
-
Additionally, naming conventions for colors and typography are included
12
-
to help ensure deeper interoperability with components from various other libraries.
13
-
This is also intended to help ensure that themes created for Theme UI are suitable for white-label applications and general purpose theming.
9
+
Theme UI is based on a theme specification, which can be used in other libraries and applications for increased interoperability.
10
+
This specification is also intended to help ensure that themes created for Theme UI are suitable for white-label applications and general purpose theming.
14
11
15
12
The theme object is made up of the following data types:
16
13
@@ -73,11 +70,6 @@ The `theme.colors` scale (i.e. color palette) should be an object literal with t
73
70
74
71
Other color keys can be added, including raw color values for aliasing the values above.
75
72
76
-
<!--
77
-
##AliasingColors
78
-
TK
79
-
-->
80
-
81
73
## Color Modes
82
74
83
75
To use Theme UI color modes, color scales should include _at least_ a `text` and `background` color.
@@ -151,6 +143,8 @@ Font sizes are typically defined as an array, from smallest to largest.
151
143
}
152
144
```
153
145
146
+
Number values will be converted to pixel units. For other units, use string values, e.g. `'1em'`.
147
+
154
148
<Note>
155
149
156
150
Arrays are _not_ required, and plain objects will work as well.
@@ -252,6 +246,13 @@ The Theme UI `styles` object is primarily used as a way to style MDX content
252
246
and helps avoid the need to use global CSS.
253
247
The styles defined within this object can also be used with the [`Styled`](/styled) component.
254
248
249
+
<Note>
250
+
251
+
The `styles` object is essentially an MDX-specific *variant*
252
+
that maps directly to each MDX component.
253
+
254
+
</Note>
255
+
255
256
The `theme.styles` object may include the following keys, which map to elements that can be rendered by markdown:
256
257
257
258
-`p` (paragraph)
@@ -332,6 +333,12 @@ Variants can also be used within the `theme.styles` object.
332
333
}
333
334
```
334
335
336
+
## Aliasing Colors and Other Scales
337
+
338
+
In many design systems, developers choose to create an additional layer of abstraction for mapping individual components to specific scale values.
339
+
With Theme UI, *variants* are the mechanism to use for such abstractions.
340
+
341
+
335
342
## Breakpoints
336
343
337
344
To configure the default breakpoints used in responsive array values, add a `breakpoints` array to your theme.
0 commit comments