move style out of root to minimize html redrawing and improve maintainability
parent
fc7069ca57
commit
a2477864a3
|
@ -23,20 +23,5 @@
|
||||||
</head>
|
</head>
|
||||||
<body {% block body_attributes %}id="{%block pagetype %}{% endblock %}"{% endblock %}>
|
<body {% block body_attributes %}id="{%block pagetype %}{% endblock %}"{% endblock %}>
|
||||||
{% block body required %}{% endblock %}
|
{% block body required %}{% endblock %}
|
||||||
<style>
|
|
||||||
body {
|
|
||||||
{% if SITE_NAME == 'rDrama' and (not v or v.is_banned or v.agendaposter) %}
|
|
||||||
background:url(/assets/images/backgrounds/glitter/1.webp?v=3) center center fixed;
|
|
||||||
background-color: var(--background);
|
|
||||||
background-size: cover;
|
|
||||||
{% elif v and v.background %}
|
|
||||||
background:url(/assets/images/backgrounds/{{v.background}}?v=3) center center fixed;
|
|
||||||
background-color: var(--background);
|
|
||||||
{% if 'anime' not in v.background %}
|
|
||||||
background-size: cover;
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -107,6 +107,20 @@
|
||||||
{% macro stylesheets(include_user_css) %}
|
{% macro stylesheets(include_user_css) %}
|
||||||
<link rel="stylesheet" href="{{'css/main.css' | asset}}">
|
<link rel="stylesheet" href="{{'css/main.css' | asset}}">
|
||||||
<link id="favicon" rel="icon" type="image/webp" href="{{'icon.webp' | asset_siteimg}}">
|
<link id="favicon" rel="icon" type="image/webp" href="{{'icon.webp' | asset_siteimg}}">
|
||||||
|
|
||||||
|
{% if SITE_NAME == 'rDrama' and (not v or v.is_banned or v.agendaposter) %}
|
||||||
|
{% set background = '/assets/images/backgrounds/glitter/1.webp?v=3' %}
|
||||||
|
{% elif v and v.background %}
|
||||||
|
{% set background = v.background %}
|
||||||
|
{% endif %}
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background:url({{background}}) center center fixed;
|
||||||
|
background-color: var(--background);
|
||||||
|
{% if 'anime' not in background %}background-size: cover;{% endif %}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
|
|
Loading…
Reference in New Issue