#34399: admin site: dark-mode-vars block is overwritten by extrastyles
-----------------------------------------+--------------------------------
Reporter: TheFissk | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.1
Severity: Normal | Keywords: dark-mode-vars
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+--------------------------------
When themeing the admin site the dark-mode-vars block is overwritten by
the extrastyle block. making styling both impossible
example:
{{{
{% block extrastyle %}{{ block.super }}
<style>
:root {
--primary: red; /*will style primary red*/
}
</style>
{% endblock %}
{% block dark-mode-vars %}{{ block.super }}
<style>
:root {
--body-bg: green; /*will remain styled red in dark mode.*/
}
</style>
{% endblock %}
}}}
Also annoyingly styles applied in the "dark-mode-vars" block will leak to
lightmode if they are not protected with the media prefers-color-scheme
query.
This can be worked around by encasing the extrastyle styles in the
"prefers-color-scheme: light" query, but if this is going to remain the
behaviour the documentation should be updated to reflect it.
--
Ticket URL: <https://code.djangoproject.com/ticket/34399>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/01070186c8f8e2e4-d9126d5a-079d-4e4f-aaec-e085a82b5016-000000%40eu-central-1.amazonses.com.