Isolate common stylesheets
This commit is contained in:
parent
50b6e0104b
commit
00fc29c6ad
3 changed files with 9 additions and 8 deletions
|
@ -13,6 +13,12 @@ const app = {
|
|||
link: {
|
||||
icon: appIconURL,
|
||||
},
|
||||
styleSheets: [robotoFontStyle, appStyle]
|
||||
.map((rawSheet) => {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(rawSheet);
|
||||
return sheet;
|
||||
}),
|
||||
page: null,
|
||||
router: new Router(),
|
||||
loader: WDLoader.instance,
|
||||
|
@ -23,12 +29,7 @@ const app = {
|
|||
<meta name="viewport" content="${app.meta.viewport}">
|
||||
`;
|
||||
document.title = app.title;
|
||||
document.adoptedStyleSheets = [robotoFontStyle, appStyle]
|
||||
.map((rawSheet) => {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(rawSheet);
|
||||
return sheet;
|
||||
});
|
||||
document.adoptedStyleSheets = app.styleSheets;
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class HomePage {
|
|||
#addPageStyle() {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(pageStyle);
|
||||
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
||||
document.adoptedStyleSheets = [...app.styleSheets, sheet];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,7 +26,7 @@ class RoutesPage {
|
|||
#addPageStyle() {
|
||||
const sheet = new CSSStyleSheet();
|
||||
sheet.replaceSync(pageStyle);
|
||||
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet];
|
||||
document.adoptedStyleSheets = [...app.styleSheets, sheet];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue