Skip to content

Commit b7ebd2b

Browse files
Laurie BarthLaurie Barth
authored andcommitted
clean up based on changes to base preset PR
1 parent 14a21cc commit b7ebd2b

File tree

5 files changed

+5
-25
lines changed

5 files changed

+5
-25
lines changed

packages/gatsby-plugin-theme-ui/README.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ prevent a flash of unstyled colors when using color modes.
2020

2121
| Key | Default value | Description |
2222
| ------------------------ | ---------------- | -------------------------------------------------------------------------------- |
23-
| `themeModule` | `null` | JSON theme object, use the `require` syntax to include it in options. Make sure the package you're requiring is installed in your dependencies. |
24-
| `themeModulePath` | `null` | A string package name that the plugin will require for you. Make sure the package you're requiring is installed in your dependencies. |
25-
| `moduleExportName` | `default` | The name of the export from the theme module, applies to `themeModule` or `themeModulePath` resolution depending which one you're using |
2623
| `prismPreset` | `null` | The name of the preset you'd like to use to style code blocks inside your markdown files. The available presets can be found in the [theme-ui docs](https://theme-ui.com/packages/prism/). You can also use a package string of your own choosing. |
2724

28-
> Note that if your theme is exported at the top level, the `moduleExportName` of `default` is bypassed. See [theme-ui/preset-deep](https://github.com/system-ui/theme-ui/blob/master/packages/preset-deep/src/index.ts).
29-
3025
The theme module you include in options is considered your base theme. Any further customization and shadowing will be merged with it.
3126

3227
### Using options
@@ -37,8 +32,6 @@ module.exports = {
3732
plugins: [
3833
{ resolve: 'gatsby-plugin-theme-ui',
3934
options: {
40-
themeModulePath: '@theme-ui/preset-funk',
41-
// or themeModule: require('@theme-ui/preset-funk')
4235
prismPreset: 'night-owl'
4336
}
4437
}],

packages/gatsby-plugin-theme-ui/gatsby-node.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,11 @@ exports.onPreInit = ({ reporter }, options) => {
99
try {
1010
options.prismPreset = require(prismPreset)
1111
} catch {
12-
reporter.error(
13-
`It appears the prism dependency is not installed. Try running \`${generateInstallInstructions()}\n\n${prismPreset}\``
14-
)
12+
reporter.warn(`It appears the prism dependency is not installed.`)
1513
}
1614
}
1715
}
1816

19-
function generateInstallInstructions() {
20-
const { getConfigStore } = require(`gatsby-core-utils`)
21-
22-
const packageMangerConfigKey = `cli.packageManager`
23-
const PACKAGE_MANGER = getConfigStore().get(packageMangerConfigKey) || `yarn`
24-
25-
const installKeyWord = PACKAGE_MANGER === `yarn` ? 'add' : 'install'
26-
27-
return `${PACKAGE_MANGER} ${installKeyWord}`
28-
}
29-
3017
exports.createSchemaCustomization = ({ actions }) => {
3118
const { createTypes } = actions
3219

packages/gatsby-plugin-theme-ui/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"license": "MIT",
77
"peerDependencies": {
88
"gatsby": "^2.13.1",
9-
"theme-ui": "^0.3.0",
10-
"gatsby-core-utils": "^1.2.0"
9+
"theme-ui": "^0.3.0"
1110
},
1211
"keywords": [
1312
"gatsby",

packages/gatsby-plugin-theme-ui/src/provider.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** @jsx jsx */
22
import { jsx, ThemeProvider, merge } from 'theme-ui'
3-
import theme from './index'
3+
import localTheme from './index'
44
import components from './components'
55
import useThemeUiConfig from './hooks/configOptions'
66

@@ -17,7 +17,7 @@ const Root = ({ children }) => {
1717
}
1818
)
1919

20-
const fullTheme = merge(themeWithPrism, theme)
20+
const fullTheme = merge(themeWithPrism, localTheme)
2121

2222
return (
2323
<ThemeProvider theme={fullTheme} components={components}>

packages/gatsby-plugin-theme-ui/utils/preset-dictionary.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = {
99
'prism-coy': '@theme-ui/prism/presets/prism-coy.json',
1010
'prism-dark': '@theme-ui/prism/presets/prism-dark.json',
1111
'prism-funky': '@theme-ui/prism/presets/prism-funky.json',
12+
'prism-okaidia': '@theme-ui/prism/presets/prism-okaidia.json',
1213
'prism-solarizedlight': '@theme-ui/prism/presets/prism-solarizedlight.json',
1314
'prism-tomorrow': '@theme-ui/prism/presets/prism-tomorrow.json',
1415
'prism-twilight': '@theme-ui/prism/presets/prism-twilight.json',

0 commit comments

Comments
 (0)