feat: new font settings and week number on date widget

This commit is contained in:
David Ralph
2021-03-19 17:44:27 +00:00
parent 9ea6c18cd2
commit 8f74095a85
9 changed files with 71 additions and 11 deletions

View File

@@ -91,16 +91,28 @@ export default class SettingsFunctions {
if (font) {
const google = localStorage.getItem('fontGoogle');
let url = '';
let url, fontweight, fontstyle = '';
if (google === 'true') {
url = `@import url('https://fonts.googleapis.com/css2?family=${font}&display=swap');`;
}
const fontWeight = localStorage.getItem('fontWeight');
if (fontWeight) {
fontweight = `font-weight: ${fontWeight};`;
}
const fontStyle = localStorage.getItem('fontStyle');
if (fontStyle) {
fontstyle = `font-style: ${fontStyle};`;
}
document.head.insertAdjacentHTML('beforeend', `
<style>
${url}
* {
font-family: '${font}', 'Lexend Deca' !important;
${fontweight}
${fontstyle}
}
</style>`);
}