mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-28 21:04:47 +00:00
29 lines
902 B
HTML
29 lines
902 B
HTML
{% extends "!layout.html" %}
|
|
|
|
{% block extrahead %}
|
|
<!-- Custom styles and script to prevent FOUC in Safari only -->
|
|
<style>
|
|
body.safari-hidden {
|
|
visibility: hidden;
|
|
/* Hide body until the theme is applied in Safari */
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
|
|
if (isSafari) {
|
|
document.body.classList.add('safari-hidden'); // Hide body in Safari
|
|
|
|
const savedTheme = localStorage.getItem('theme') || 'light'; // Default to light theme
|
|
document.documentElement.setAttribute('data-theme', savedTheme);
|
|
document.body.style.visibility = 'visible'; // Make visible once theme is applied
|
|
}
|
|
});
|
|
</script>
|
|
{% endblock extrahead %}
|
|
|
|
{% block scripts_end %}
|
|
{{ super() }}
|
|
{% endblock %}
|