git.iko.soy/rowtype-yoga/psfp
on master help sign in
No idea why but it's much better now
c2baa78Mark Eibes
blog/.vscode/settings.jsonnew file+4
@@ -0,0 +1,4 @@
1+{
2+ "workbench.preferredDarkColorTheme": "Base2Tone_HeathDark",
3+ "workbench.colorTheme": "Base2Tone_FieldDark"
4+}
blog/gatsby-browser.jsnew file+21
@@ -0,0 +1,21 @@
1+import React from "react";
2+import {JssProvider, SheetsRegistry} from 'react-jss'
3+
4+export const onInitialClientRender = () => {
5+ if (process.env.BUILD_STAGE === `develop`) {
6+ return;
7+ }
8+
9+ // Remove the server-side injected CSS.
10+ const jssStyles = document.querySelector(`#jss-server-side`);
11+ if (jssStyles) {
12+ jssStyles.parentNode.removeChild(jssStyles);
13+ }
14+};
15+
16+export const wrapRootElement = ({ element }) => {
17+
18+ return element;
19+// return <StylesProvider {...stylesProvider}>{element}</StylesProvider>;
20+// return <JssProvider registry={sheets}>{element}</JssProvider>
21+};
blog/gatsby-node.jsnew file

No changes to the content.

blog/gatsby-ssr.jsnew file+37
@@ -0,0 +1,37 @@
1+import React from 'react'
2+import {JssProvider, SheetsRegistry} from 'react-jss'
3+
4+const globalLeak = new Map();
5+
6+export const wrapRootElement = ({ element, pathname }) => {
7+ const sheets = new SheetsRegistry()
8+ globalLeak.set(pathname, sheets);
9+
10+ return <JssProvider registry={sheets}>{element}</JssProvider>
11+}
12+
13+export const onRenderBody = (
14+ { setHeadComponents, pathname },
15+ ) => {
16+ const sheets = globalLeak.get(pathname);
17+
18+ if (!sheets) {
19+ return;
20+ }
21+
22+ const css = sheets.toString();
23+
24+ // css = disableAutoprefixing ? css : autoprefixer(css, pathname);
25+ // css = disableMinification ? css : cleanCSS.minify(css).styles;
26+
27+ setHeadComponents([
28+ <style
29+ id="jss-server-side"
30+ key="jss-server-side"
31+ dangerouslySetInnerHTML={{ __html: css }}
32+ />,
33+ ]);
34+
35+ globalLeak.delete(pathname);
36+ };
37+
blog/package-lock.json+8
@@ -8875,6 +8875,14 @@
8875 "@babel/runtime": "^7.2.0"
8875 "@babel/runtime": "^7.2.0"
8876 }
8876 }
8877 },
8877 },
8878+ "gatsby-plugin-better-jss": {
8879+ "version": "1.0.3",
8880+ "resolved": "https://registry.npmjs.org/gatsby-plugin-better-jss/-/gatsby-plugin-better-jss-1.0.3.tgz",
8881+ "integrity": "sha512-1NG68s+8vpknG4CpaH7a3ac0NItWNsk8HWma9wr+NnuCYM8buBnE1MbYzbycKYkjNZZ6DAeISJpKqtbheJPyYg==",
8882+ "requires": {
8883+ "@babel/runtime": "^7.0.0"
8884+ }
8885+ },
8878 "gatsby-plugin-manifest": {
8886 "gatsby-plugin-manifest": {
8879 "version": "2.3.3",
8887 "version": "2.3.3",
8880 "resolved": "https://registry.npmjs.org/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.3.3.tgz",
8888 "resolved": "https://registry.npmjs.org/gatsby-plugin-manifest/-/gatsby-plugin-manifest-2.3.3.tgz",
blog/package.json+1
@@ -11,6 +11,7 @@
11 "gatsby": "^2.19.45",
11 "gatsby": "^2.19.45",
12 "gatsby-image": "^2.2.8",
12 "gatsby-image": "^2.2.8",
13 "gatsby-plugin-alias-imports": "^1.0.5",
13 "gatsby-plugin-alias-imports": "^1.0.5",
14+ "gatsby-plugin-better-jss": "^1.0.3",
14 "gatsby-plugin-manifest": "^2.3.2",
15 "gatsby-plugin-manifest": "^2.3.2",
15 "gatsby-plugin-mdx": "^1.0.0",
16 "gatsby-plugin-mdx": "^1.0.0",
16 "gatsby-plugin-offline": "^2.2.4",
17 "gatsby-plugin-offline": "^2.2.4",