diff --git a/README.md b/README.md index feb8c9c8..42cc457a 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,11 @@ module.exports = { Hello World! `, + customStyles: ` + pre.CodeMirror-line { + font-size: 15px; + } + `, webpackConfig: () => ({ // Custom webpack config goes here... }) diff --git a/src/index.js b/src/index.js index 7acc579c..e0e95b6e 100644 --- a/src/index.js +++ b/src/index.js @@ -14,6 +14,15 @@ const widths = playroomConfig.widths || [320, 375, 768, 1024]; const outlet = document.createElement('div'); document.body.appendChild(outlet); +if (typeof playroomConfig.customStyles === 'string') { + const customStyles = document.createElement('style'); + document.head.appendChild(customStyles); + customStyles.type = 'text/css'; + customStyles.appendChild( + document.createTextNode(playroomConfig.customStyles) + ); +} + export const store = localforage.createInstance({ name: playroomConfig.storageKey, version: 1