Skip to content

Commit bce861b

Browse files
committed
Added if check to see if user is using custom CSS
1 parent 310271c commit bce861b

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

server/layout.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,16 @@ module.exports = function(state, body = '') {
4040
type="text/css"
4141
href="${assets.get('app.css')}"
4242
/>
43-
<link
44-
rel="stylesheet"
45-
type="text/css"
46-
href="${state.ui.assets.custom_css}"
47-
/>
43+
<script>
44+
var custom_css_file = '${state.ui.assets.custom_css}';
45+
if (custom_css_file!="undefined") {
46+
var custom_css_enabled = document.createElement('link');
47+
custom_css_enabled.rel = 'stylesheet';
48+
custom_css_enabled.type = 'text/css';
49+
custom_css_enabled.href = '${state.ui.assets.custom_css}';
50+
document.head.appendChild(custom_css_enabled);
51+
}
52+
</script>
4853
<link
4954
rel="apple-touch-icon"
5055
sizes="180x180"

0 commit comments

Comments
 (0)