Skip to content

Commit 1134e9f

Browse files
committed
Add customize functionality in layouts
1 parent adbd6a7 commit 1134e9f

2 files changed

Lines changed: 34 additions & 2 deletions

File tree

src/app/app-blank-layout.hbs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@
1313
<!-- Place favicon.ico in the root directory -->
1414

1515
<link rel="stylesheet" href="css/vendor.css">
16-
<link rel="stylesheet" href="css/app.css">
16+
17+
<!-- Theme initialization -->
18+
<script>
19+
var themeSettings = (localStorage.getItem('themeSettings')) ? JSON.parse(localStorage.getItem('themeSettings')) : {};
20+
var themeName = themeSettings.themeName || '';
21+
22+
if (themeName) {
23+
document.write('<link rel="stylesheet" id="theme-style" href="css/app-' + themeName + '.css">');
24+
}
25+
else {
26+
document.write('<link rel="stylesheet" id="theme-style" href="css/app.css">');
27+
}
28+
</script>
1729
</head>
1830
<body>
1931
<div class="app blank sidebar-opened">
@@ -24,6 +36,10 @@
2436
{{/block}}
2537
</article>
2638
</div>
39+
<!-- Reference block for JS -->
40+
<div class="ref" id="ref">
41+
<div class="color-primary"></div>
42+
</div>
2743
<script src="js/vendor.js"></script>
2844
<script src="js/app.js"></script>
2945
</body>

src/auth/auth-layout.hbs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,19 @@
1313
<!-- Place favicon.ico in the root directory -->
1414

1515
<link rel="stylesheet" href="css/vendor.css">
16-
<link rel="stylesheet" href="css/app.css">
16+
17+
<!-- Theme initialization -->
18+
<script>
19+
var themeSettings = (localStorage.getItem('themeSettings')) ? JSON.parse(localStorage.getItem('themeSettings')) : {};
20+
var themeName = themeSettings.themeName || '';
21+
22+
if (themeName) {
23+
document.write('<link rel="stylesheet" id="theme-style" href="css/app-' + themeName + '.css">');
24+
}
25+
else {
26+
document.write('<link rel="stylesheet" id="theme-style" href="css/app.css">');
27+
}
28+
</script>
1729
</head>
1830
<body>
1931
<div class="main-wrapper">
@@ -27,6 +39,10 @@
2739
</article>
2840
</div>
2941
</div>
42+
<!-- Reference block for JS -->
43+
<div class="ref" id="ref">
44+
<div class="color-primary"></div>
45+
</div>
3046
<script src="js/vendor.js"></script>
3147
<script src="js/app.js"></script>
3248
</body>

0 commit comments

Comments
 (0)