Add cssprops in a css.php module instead of by-JS loaded

This commit is contained in:
Niko 2022-02-25 17:32:22 +01:00
parent ba0afb813b
commit 4d4cb14a2a
5 changed files with 12 additions and 17 deletions

View File

@ -0,0 +1,7 @@
<style>
:root {
--clr_quiz: #0064ff;
--content_max_width: 50em;
--meet_actions_height: 6em;
}
</style>

View File

@ -11,6 +11,7 @@
<script type="application/javascript" src="/assets/js/dayjs/es.js"></script>
<link rel="stylesheet" href="/assets/fonts/fork-awesome.min.css">
<?php tpl('app.css') ?>
<?php tpl_styles(['normalize', 'base', 'app']) ?>
<?php tpl_styles(['themes.'.($theme ?? DEFAULT_THEME)]) ?>
<?php tpl_styles($styles ?? null) ?>

View File

@ -23,9 +23,4 @@ var app = {
collapse_text_size: 80,
},
};
var cssprops = {
clr_quiz: '#0064ff',
content_max_width: '40em',
meet_actions_height: '6em',
};
</script>

View File

@ -397,15 +397,6 @@ window.addEventListener('load', function(e) {
calcCustomCss();
});
window.addEventListener('resize', function(e) { calcHeightMobile() });
(function() {
if (window.cssprops !== undefined) {
const keys = Object.keys(window.cssprops);
for (var i in keys) {
const k = keys[i];
document.querySelector(':root').style
.setProperty('--'+k, window.cssprops[k]);
}
window.cssprops = undefined;
}
})();
window.addEventListener('resize', function(e) {
calcHeightMobile();
});

View File

@ -25,6 +25,7 @@ app.pages.meet = {
dom.innerHTML = app.template.fill({}, tpl);
});
}
app.preload.home();
});
},
loadMore: function() {