Skip to content

Commit

Permalink
feat: create gatsby-plugin-glaze package
Browse files Browse the repository at this point in the history
  • Loading branch information
kripod committed Mar 24, 2020
1 parent 934f732 commit 6aa6fb9
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
.env
.eslintcache
node_modules/
pkg/
public/
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-glaze/pkg/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# gatsby-plugin-glaze

Applies glaze theming on Gatsby sites. Use along with `gatsby-plugin-treat`.
11 changes: 11 additions & 0 deletions packages/gatsby-plugin-glaze/pkg/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { GlazeProvider } from 'glaze';
import React from 'react';

import theme from './src/theme.treat';

/**
* @param {{ element: React.ReactNode }} apiCallbackContext
*/
export function wrapRootElement({ element }) {
return <GlazeProvider theme={theme}>{element}</GlazeProvider>;
}
1 change: 1 addition & 0 deletions packages/gatsby-plugin-glaze/pkg/gatsby-ssr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { wrapRootElement } from './gatsby-browser';
18 changes: 18 additions & 0 deletions packages/gatsby-plugin-glaze/pkg/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "gatsby-plugin-glaze",
"version": "0.0.0",
"description": "Applies glaze theming on Gatsby sites",
"keywords": [
"gatsby",
"gatsby-plugin",
"glaze",
"css-in-js"
],
"repository": "github:kripod/glaze",
"license": "MIT",
"author": "Kristóf Poduszló <kripod@protonmail.com>",
"peerDependencies": {
"gatsby": "^2.0.0",
"glaze": "^0.0.0"
}
}
3 changes: 3 additions & 0 deletions packages/gatsby-plugin-glaze/pkg/src/theme.treat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createTheme, defaultTheme } from 'glaze';

export default createTheme(defaultTheme);
1 change: 1 addition & 0 deletions packages/glaze/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pkg/

0 comments on commit 6aa6fb9

Please sign in to comment.