module.exports = function(style, options) { // https://necolas.github.io/normalize.css/ const normalizeCss = ` html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible} pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects} b,strong{font-weight:bolder}small{font-size:80%}img{border-style:none} `; const fontFamily = "'Avenir', 'Arial', sans-serif"; const listMarginLeft = '1.7em'; const css = ` body { font-size: ` + style.htmlFontSize + `; color: ` + style.htmlColor + `; line-height: ` + style.htmlLineHeight + `; background-color: ` + style.htmlBackgroundColor + `; font-family: ` + fontFamily + `; padding-bottom: ` + options.paddingBottom + `; } strong { color: ` + style.colorBright + ` } ::-webkit-scrollbar { width: 7px; height: 7px; } ::-webkit-scrollbar-corner { background: none; } ::-webkit-scrollbar-track { border: none; } ::-webkit-scrollbar-thumb { background: rgba(100, 100, 100, 0.3); border-radius: 5px; } ::-webkit-scrollbar-track:hover { background: rgba(0, 0, 0, 0.1); } ::-webkit-scrollbar-thumb:hover { background: rgba(100, 100, 100, 0.7); } /* Remove top padding and margin from first child so that top of rendered text is aligned to top of text editor text */ #rendered-md h1:first-child, #rendered-md h2:first-child, #rendered-md h3:first-child, #rendered-md h4:first-child, #rendered-md ul:first-child, #rendered-md ol:first-child, #rendered-md table:first-child, #rendered-md blockquote:first-child, #rendered-md img:first-child, #rendered-md p:first-child { margin-top: 0; padding-top: 0; } p, h1, h2, h3, h4, h5, h6, ul, table { margin-top: .6em; margin-bottom: .65em; } h1, h2, h3, h4, h5, h6 { line-height: 1.5em; } h1 { font-size: 1.5em; font-weight: bold; border-bottom: 1px solid ` + style.htmlDividerColor + `; padding-bottom: .3em; } h2 { font-size: 1.3em; font-weight: bold; padding-bottom: .1em; */ } h3 { font-size: 1.1em; } h4, h5, h6 { font-size: 1em; font-weight: bold; } a { color: ` + style.htmlLinkColor + `; } ul, ol { padding-left: 0; margin-left: 1.7em; } li { margin-bottom: .4em; } li p { margin-top: 0.2em; margin-bottom: 0; } .resource-icon { display: inline-block; position: relative; top: .5em; text-decoration: none; width: 1.15em; height: 1.45em; margin-right: 0.4em; background-color: ` + style.htmlColor + `; /* Awesome Font file */ -webkit-mask: url("data:image/svg+xml;utf8,"); } blockquote { border-left: 4px solid ` + style.htmlCodeBorderColor + `; padding-left: 1.2em; margin-left: 0; opacity: .7; } table { text-align: left-align; border-collapse: collapse; border: 1px solid ` + style.htmlCodeBorderColor + `; background-color: ` + style.htmlBackgroundColor + `; } td, th { padding: .5em 1em .5em 1em; font-size: ` + style.htmlFontSize + `; color: ` + style.htmlColor + `; font-family: ` + fontFamily + `; } td { border: 1px solid ` + style.htmlCodeBorderColor + `; } th { border: 1px solid ` + style.htmlCodeBorderColor + `; border-bottom: 2px solid ` + style.htmlCodeBorderColor + `; background-color: ` + style.htmlTableBackgroundColor + `; } tr:nth-child(even) { background-color: ` + style.htmlTableBackgroundColor + `; } tr:hover { background-color: ` + style.raisedBackgroundColor + `; } hr { border: none; border-bottom: 2px solid ` + style.htmlDividerColor + `; } img { max-width: 100%; height: auto; } .inline-code { border: 1px solid ` + style.htmlCodeBorderColor + `; background-color: ` + style.htmlCodeBackgroundColor + `; padding-right: .2em; padding-left: .2em; border-radius: .25em; color: ` + style.htmlCodeColor + `; font-size: ` + style.htmlCodeFontSize + `; } .highlighted-keyword { background-color: #F3B717; color: black; } .not-loaded-resource img { width: 1.15em; height: 1.15em; background: white; padding: 2px !important; border-radius: 2px; box-shadow: 0 1px 3px #000000aa; } a.not-loaded-resource img { margin-right: .2em; } a.not-loaded-resource { display: flex; flex-direction: row; align-items: center; } .checkbox-label-checked { opacity: 0.5; } @media print { body { height: auto !important; } pre { white-space: pre-wrap; } .code, .inline-code { border: 1px solid #CBCBCB; } } `; return [normalizeCss, css]; }