Skip to content

Commit cb626e7

Browse files
committed
Use CSS variables for colors
More recent versions of Django admin use CSS variables to control the theming color, allowing a user to chose their color scheme independently from their preferred one. Previously, django-polymorphic supported different color schemes only via the `prefers-color-scheme` media query. This commit implements usage of CSS variables for colors, ensuring consistent compatibility with the rest of the admin interface.
1 parent cfd49b2 commit cb626e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

polymorphic/static/polymorphic/css/polymorphic_inlines.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
position: absolute;
1212
top: 2.2em;
1313
left: 0.5em;
14-
border: 1px solid #ccc;
14+
border: 1px solid var(--border-color, #ccc);
1515
border-radius: 4px;
1616
padding: 2px;
17-
background-color: #fff;
17+
background-color: var(--body-bg, #fff);
1818
z-index: 1000;
1919
}
2020

@@ -35,7 +35,7 @@
3535

3636
@media (prefers-color-scheme: dark) {
3737
.polymorphic-type-menu {
38-
border: 1px solid #121212;
39-
background-color: #212121;
38+
border: 1px solid var(--border-color, #121212);
39+
background-color: var(--body-bg, #212121);
4040
}
4141
}

0 commit comments

Comments
 (0)