Add cssprops in a css.php module instead of by-JS loaded
This commit is contained in:
parent
ba0afb813b
commit
4d4cb14a2a
|
@ -0,0 +1,7 @@
|
|||
<style>
|
||||
:root {
|
||||
--clr_quiz: #0064ff;
|
||||
--content_max_width: 50em;
|
||||
--meet_actions_height: 6em;
|
||||
}
|
||||
</style>
|
|
@ -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) ?>
|
||||
|
|
|
@ -23,9 +23,4 @@ var app = {
|
|||
collapse_text_size: 80,
|
||||
},
|
||||
};
|
||||
var cssprops = {
|
||||
clr_quiz: '#0064ff',
|
||||
content_max_width: '40em',
|
||||
meet_actions_height: '6em',
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -25,6 +25,7 @@ app.pages.meet = {
|
|||
dom.innerHTML = app.template.fill({}, tpl);
|
||||
});
|
||||
}
|
||||
app.preload.home();
|
||||
});
|
||||
},
|
||||
loadMore: function() {
|
||||
|
|
Loading…
Reference in New Issue