macOS
^1.2.0
I can decide how to load CSS myself/given instructions on how to set up my react app to work with this lib
Codemirror css is imported inside the module, so I can't load it in a way that works with next.js
Maybe document what loader is recommended to make this file load? I have a workaround to load it in next.js, so I can load the playground css via import playgroundCSS from 'graphql-playground/playground.css' and inline it, but since the codemirror css is imported somewhere inside this lib, it's out of my control.
yarn add next react react-dom./pages/index.js with contents:import React from 'react'
import Playground from 'graphql-playground'
export default = () => <Playground endpoint={'/graphql'} />
Error in codemirror/lib/codemirror.css
Module parse failed: /Users/.../frontend-admin/node_modules/codemirror/lib/codemirror.css Unexpected token (3:0) You may need an appropriate loader to handle this file type. | /* BASICS */ | | .CodeMirror { | /* Set height, width, borders, and global font properties here */ | font-family: monospace;
tl:dr You may need an appropriate loader to handle this file type.
this will do all the steps for you (bash)
mkdir graphql-playground-issue-279 &&\
cd graphql-playground-issue-279 &&\
yarn init -y &&\
yarn add next react react-dom &&\
mkdir pages &&\
touch pages/index.js &&\\n
echo "import React from 'react'\\n
import Playground from 'graphql-playground'\\n
export default = () => <Playground endpoint={'/graphql'} />\
" >> pages/index.js &&\
./node_modules/.bin/next dev
The easiest solution I can see to this is to just let the user import the codemirror css manually, however they like 馃憤
This is actually a good point @albinekb ! Thanks for raising this!
This will be fixed with #641
Everything it's now inside styled-components
Well done!