At the moment, docz-theme-default preloads a hard-coded collection of fonts:
Not all of them are always necessary, especially when the theme is configured to use some alternative font, e.g. like this:
themeConfig: {
styles: {
body: {
fontFamily: '"My Cool Font", sans-serif',
},
h1: {
fontFamily: '"My Other Cool Font", serif',
fontWeight: "normal",
fontSize: 48,
},
},
},
It'd be great if the argument of webfont.load() was a part of the theme config so that the developers could load alternative fonts. When all selected fonts are built-in, the argument can be set to an empty object to avoid unnecessary network requests:
themeConfig: {
styles: {
body: { fontFamily: 'Helvetica, sans-serif' },
h1: { fontFamily: 'Helvetica, sans-serif' },
h2: { fontFamily: 'Helvetica, sans-serif' },
code: { fontFamily: '"Courier New", sans-serif' },
pre: { fontFamily: '"Courier New", sans-serif' },
table: { fontFamily: '"Courier New", sans-serif' },
},
fontsToLoad: {}
},
No need to fetch stuff from google → docz works offline and in internal-only networks. WDYT?
will the new version can give a solution of this issue @pedronauck
Add codemirror is same issue, I hope can load local codemirror.css file instead of download css file from codemirror.net
Most helpful comment
Add codemirror is same issue, I hope can load local codemirror.css file instead of download css file from codemirror.net