allowthem-server 0.0.4

HTTP server and middleware for allowthem
Documentation
<!DOCTYPE html>
<html lang="en" {% block html_attrs %}{% endblock %}>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %}allowthem{% endblock %}</title>

    <script>(function(){try{var m=localStorage.getItem('allowthem:mode');if((m==='dark'||m==='light')&&!document.documentElement.hasAttribute('data-mode-locked')){document.documentElement.dataset.mode=m;}}catch(_e){}})();</script>

    <link rel="stylesheet" href="/__allowthem/static/css/01-tokens.css">
    <link rel="stylesheet" href="/__allowthem/static/css/02-base.css">
    <link rel="stylesheet" href="/__allowthem/static/css/03-layout.css">
    <link rel="stylesheet" href="/__allowthem/static/css/04-components.css">
    <link rel="stylesheet" href="/__allowthem/static/css/05-utilities.css">

    {% block theme %}
    {% if accent %}
    <style>
        :root {
            --accent: {{ accent }};
            --accent-ink: {{ accent_ink | default("#000000") }};
        }
        {% if accent_light %}
        html[data-mode="light"] {
            --accent: {{ accent_light }};
            --accent-ink: {{ accent_ink_light | default("#ffffff") }};
        }
        {% endif %}
    </style>
    {% endif %}
    {% endblock %}

    {% block head %}{% endblock %}
</head>
{% set body_class_rendered %}{% block body_class %}{% endblock %}{% endset %}
<body{% if body_class_rendered %} class="{{ body_class_rendered }}"{% endif %}>
    {% block body_content %}{% block body %}{% endblock %}{% endblock %}

    <script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js"
            integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz"
            crossorigin="anonymous"></script>
    <script src="/__allowthem/static/js/echo.js" defer></script>
    {% block scripts %}{% endblock %}
</body>
</html>