File tree Expand file tree Collapse file tree 4 files changed +11
-14
lines changed
packages/gatsby-plugin-theme-ui Expand file tree Collapse file tree 4 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ prevent a flash of unstyled colors when using color modes.
20
20
21
21
| Key | Default value | Description |
22
22
| ------------------------ | ---------------- | -------------------------------------------------------------------------------- |
23
- | ` themePreset ` | ` null ` | This can be a JSON theme object or a string package name. Make sure the package you're requiring is installed in your dependencies. |
23
+ | ` preset ` | ` null ` | This can be a JSON theme object or a string package name. Make sure the package you're requiring is installed in your dependencies. |
24
24
25
25
> Note that this plugin assumes the theme object is exported as ` default ` .
26
26
Original file line number Diff line number Diff line change 1
1
exports . onPreInit = ( __ , options ) => {
2
- let { themePreset } = options
2
+ let { preset } = options
3
3
4
- if ( typeof themePreset === 'string' ) {
4
+ if ( typeof preset === 'string' ) {
5
5
try {
6
- options . themePreset = require ( themePreset )
6
+ options . preset = require ( preset )
7
7
} catch {
8
8
reporter . error (
9
9
`It appears your theme dependency is not installed. Try running \`${ generateInstallInstructions ( ) } ${ themeModule } \``
@@ -28,19 +28,16 @@ exports.createSchemaCustomization = ({ actions }) => {
28
28
29
29
createTypes ( `
30
30
type ThemeUiConfig implements Node {
31
- themePreset : JSON,
31
+ preset : JSON,
32
32
}
33
33
` )
34
34
}
35
35
36
- exports . sourceNodes = (
37
- { actions, createContentDigest } ,
38
- { themePreset = { } }
39
- ) => {
36
+ exports . sourceNodes = ( { actions, createContentDigest } , { preset = { } } ) => {
40
37
const { createNode } = actions
41
38
42
39
const themeUiConfig = {
43
- themePreset ,
40
+ preset ,
44
41
}
45
42
46
43
createNode ( {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ const useThemeUiConfig = () => {
4
4
const data = useStaticQuery ( graphql `
5
5
query {
6
6
themeUiConfig(id: { eq: "gatsby-plugin-theme-ui-config" }) {
7
- themePreset
7
+ preset
8
8
}
9
9
}
10
10
` )
Original file line number Diff line number Diff line change 1
1
/** @jsx jsx */
2
2
import { jsx , ThemeProvider , merge } from 'theme-ui'
3
- import theme from './index'
3
+ import localTheme from './index'
4
4
import components from './components'
5
5
import useThemeUiConfig from './hooks/configOptions'
6
6
7
7
const Root = ( { children } ) => {
8
8
const themeUiConfig = useThemeUiConfig ( )
9
- const { themePreset } = themeUiConfig
9
+ const { preset } = themeUiConfig
10
10
11
- const theme = themePreset . default || themePreset
11
+ const theme = preset . default || preset
12
12
13
13
const fullTheme = merge ( theme , localTheme )
14
14
You can’t perform that action at this time.
0 commit comments