Skip to content

Commit 1fba5b5

Browse files
committed
feat: add disableDefaultCSS option to createConfig
1 parent fc6cb34 commit 1fba5b5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/createConfig.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function getPackageJSON() {
3131
name: pkg.name,
3232
svelte: pkg.svelte,
3333
description: pkg.description,
34+
homepage: pkg.homepage,
3435
};
3536
} catch (error) {
3637
console.log(error);
@@ -74,11 +75,21 @@ const custom_css = `
7475
}
7576
`;
7677

78+
/**
79+
*
80+
* @param {Object} opts
81+
* @param {boolean} opts.minify - set to `true` to minify the HTML/JS
82+
* @param {string} opts.outDir - set the folder to emit the files
83+
* @param {string} opts.style - custom CSS appended to the <style> block
84+
* @param {boolean} opts.disableDefaultCSS - set to `true` to omit the default GitHub styles
85+
*
86+
*/
7787
export default function createConfig(opts) {
7888
const minify = opts.minify === true;
7989
const pkg = getPackageJSON();
8090
const hash = minify ? hashREADME() : "";
8191
const output_dir = opts.outDir || "dist";
92+
8293
const template = `
8394
<!DOCTYPE html>
8495
<html lang="en">
@@ -88,7 +99,7 @@ export default function createConfig(opts) {
8899
<meta name="description" content="${pkg.description || `${pkg.name} demo`}" />
89100
<title>${pkg.name}</title>
90101
<style>
91-
${css}
102+
${!opts.disableDefaultCSS ? css : ""}
92103
${custom_css}
93104
${opts.style || ""}
94105
</style>

0 commit comments

Comments
 (0)