Skip to content

Commit d97b26c

Browse files
authored
chore: custom styles in body tag (#923)
1 parent da21c3b commit d97b26c

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/unfold/sites.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def each_context(self, request: HttpRequest) -> Dict[str, Any]:
130130
pass
131131

132132
if hasattr(self, "extra_context") and callable(self.extra_context):
133-
context = self.extra_context(context, request)
133+
return self.extra_context(context, request)
134134

135135
return context
136136

src/unfold/templates/unfold/layouts/skeleton.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@
5757
{% block blockbots %}
5858
<meta name="robots" content="NONE,NOARCHIVE">
5959
{% endblock %}
60+
</head>
6061

62+
<body class="antialiased bg-white font-sans text-font-default-light text-sm dark:bg-gray-900 dark:text-font-default-dark {% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}" data-admin-utc-offset="{% now "Z" %}" x-data="{ mainWidth: 0, activeTab: 'general', sidebarMobileOpen: false, sidebarDesktopOpen: {% if request.session.toggle_sidebar == False %}false{% else %}true{% endif %} }" x-init="activeTab = window.location.hash?.replace('#', '') || 'general'">
6163
{% if colors %}
62-
<style>
64+
<style id="unfold-theme-colors">
6365
:root {
6466
{% for name, weights in colors.items %}
6567
{% for weight, value in weights.items %}
@@ -69,9 +71,7 @@
6971
}
7072
</style>
7173
{% endif %}
72-
</head>
7374

74-
<body class="antialiased bg-white font-sans text-font-default-light text-sm dark:bg-gray-900 dark:text-font-default-dark {% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}" data-admin-utc-offset="{% now "Z" %}" x-data="{ mainWidth: 0, activeTab: 'general', sidebarMobileOpen: false, sidebarDesktopOpen: {% if request.session.toggle_sidebar == False %}false{% else %}true{% endif %} }" x-init="activeTab = window.location.hash?.replace('#', '') || 'general'">
7575
{% block base %}{% endblock %}
7676

7777
<div id="modal-overlay" class="backdrop-blur-sm bg-opacity-80 bg-gray-900 bottom-0 fixed hidden left-0 mr-1 right-0 top-0 z-50"></div>

0 commit comments

Comments
 (0)