Skip to content

Commit 9e8b505

Browse files
committed
Update migration guide
1 parent 2af1364 commit 9e8b505

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

packages/docs/src/pages/color-modes.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export default props => (
7272
)
7373
```
7474

75+
To disable this behavior, add the `useBodyStyles: false` flag to your theme.
76+
7577
## Gatsby plugin
7678

7779
For use in a Gatsby site, install and use `gatsby-plugin-theme-ui` to add the ThemeProvider to the root of your application.

packages/docs/src/pages/migrating.mdx

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,25 @@ title: Migrating
66

77
## v0.3
88

9+
### What's New
10+
11+
- Components can now be imported directly from the `theme-ui` package. Be sure that treeshaking is enabled with your build tool.
12+
- Includes smart defaults for adding base styles to the `<body>` element.
13+
- Simplified color modes API.
14+
- New `@theme-ui/css`, `@theme-ui/core`, `@theme-ui/color-modes`, and `@theme-ui/mdx` packages allow for more bespoke ways to use the library.
15+
16+
### Breaking Changes
17+
18+
- `@emotion/core` and `@mdx-js/react` are now dependencies of `theme-ui` and should not be installed separately. If you'd like to use a particular version of each library, use [Yarn resolutions](https://yarnpkg.com/lang/en/docs/selective-version-resolutions/).
919
- Theme UI context no longer provides `context.components`. If you're using this object from context, use the MDX hook instead. E.g. `import { useMDXComponents } from '@mdx-js/react'`
10-
- Color mode API:
11-
- Default color mode name
12-
- Manually enable `useColorSchemeMediaQuery`
13-
- Removes layout components (`Layout`, `Header`, `Main`, `Footer`). Use the `Box` and `Flex` layout primitives instead.
14-
- Theme context is now stateless. If you've made use of `context.setTheme`, this no longer works. An alternative approach will be introduced later.
15-
- Global typographic styles
20+
- If you'd like color mode to be initialized from the `prefers-color-scheme` media query, you must enable the `useColorSchemeMediaQuery: true` flag in your theme.
21+
- The `ColorMode` component is deprecated and no longer required to add color styles to the `<body>` element.
22+
- The following components have been removed in favor of using `Box` and `Flex` components: `Layout`, `Header`, `Main`, `Footer`
23+
- The `initialColorMode` flag no longer works, use `initialColorModeName` instead.
24+
- The `ThemeProvider` now adds global typographic styles to the `<body>` element based on `theme.styles.root`. To disable this behavior set the `useBodyStyles: false` flag in your theme.
25+
- Theme context is now stateless. If you've made use of `context.setTheme`, this no longer works. An alternative approach is available with the `@theme-ui/editor` package.
26+
- The `ThemeStateProvider` component is no longer avialable, see `@theme-ui/editor` as an alternative.
27+
- The `@theme-ui/editor` package has a completely new API. Please refer to the package's [README.md](https://github.com/system-ui/theme-ui/blob/master/packages/editor/README.md) for more information.
1628

1729
## v0.2
1830

packages/docs/src/pages/theming.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,17 @@ These values will be used to generate mobile-first (i.e. `min-width`) media quer
163163
}
164164
```
165165

166+
## Configuration Flags
167+
168+
The theme object can also include configuration options for Theme UI. The following keys can be used to enable and disable certain features.
169+
170+
Flag | Default | Description
171+
---|---|---
172+
`useCustomProperties` | `true` | Enables CSS custom properties to help mitigate a flash of unstyled content during rehydration
173+
`useBodyStyles` | `true` | Adds styles defined in `theme.styles.root` to the `<body>` element along with `color` and `background-color`
174+
`initialColorModeName` | `'default'` | The key used for the top-level color palette in `theme.colors`
175+
`useColorSchemeMediaQuery` | `false` | Initializes the color mode based on the `prefers-color-scheme` media query
176+
166177
## Example Theme
167178

168179
The following example is from the [Base Preset][example].

0 commit comments

Comments
 (0)