#33689: Django theme color variables are inconsistently named and poorly documented -------------------------------------+------------------------------------- Reporter: | Owner: nobody murraylchapman | Type: | Status: new Cleanup/optimization | Component: | Version: 4.0 contrib.admin | Keywords: theme dark mode Severity: Normal | color variables Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 1 UI/UX: 0 | -------------------------------------+------------------------------------- I have written a number of UI customizations for Django and it's difficult to be sure I've done the right thing because the color variables names and usage philosophy is inconsistent.
Consider these variables: {{{#!css --body-fg: #333; --body-bg: #fff; --body-quiet-color: #666; --body-loud-color: #000; }}} The first two are obvious since they are paired, but it's not clear the `quiet` and `loud` colors are meant to be used as foreground/text or background colors. Other variables such as `--primary` and `--selected-row` have no suffix and it's unclear how they're supposed to be used. The `--message-*-bg` variables aren't pared with any `-fg` equivalents; this creates an undocumented dependency on which text colors they are compatible with or even use. Without `-fg` equivalents it's also impossible to precisely control. I've also seen some variables used as both text and background colors in the Django CSS. Also: since the scope of these variables is `:root` it's probably a good idea to prefix them all with `--django` to avoid collisions with third- party CSS which may accidentally cause name collisions. The documentation for the theming feature just points developers at the CSS file but doesn't give any guidance on the philosophy or mechanism. It would really help if there was a consistent naming scheme and style guide for using them. -- Ticket URL: <https://code.djangoproject.com/ticket/33689> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070180ab227eb7-bfda4566-b3d5-4f68-b9a4-9aa63ba4dc1e-000000%40eu-central-1.amazonses.com.