Thanks for introducing me to a new CSS feature! I clearly don't keep up with front end stuff enough.
Re: your issues: 1. From the support grid at the bottom of the Smashing Magazine article you linked, it looks like it's only IE 11 and Edge 14 that are major browsers that don't support it. However I feel like if Django is going to announce a feature like "you can override the Admin colours", it should work in all browsers. I'm not sure if we have a written policy for this though. 2. I'm not a huge fan of an additional HTTP request for every admin page load, for every admin site in existence whether or not the colours have been overridden. HTTP/2 isn't very widely deployed still so requests still ain't cheap. 3. This can be overcome with a test to ensure the two files are in sync, I guess? And one more question: how much less painful is this to override the colours compared to the variable-less way, where you just clone the colour definitions of every rule in the original file in a second override file? On 27 April 2017 at 12:07, Patrick Guido <[email protected]> wrote: > Hi everyone! > > I think this is probably my first post here! Anyway... I was recently > working on a > django project where I was asked to change the admin theme (just the > colors). > > I did so using CSS custom properties (see [1]) so that I would have all > the colors[2] set > in one file. > > I'd like to start adopting CSS custom properties in the django admin. > It shouldn't take too much time, ideally what I'd like to do is this: > > 1. find all the colors used in the admin > 2. create a `variables/colors.css` file where we put all the colors used > in the admin > 3. add another color/background-color (or any CSS rule) where we use the > variable defined > in the previous file, so that old browsers still use the default color, > but new ones use the > color set from the variable. > > That should mostly be it, a user can override the variables by adding > another CSS file, or > by creating a new static file in `admin/css/variables/colors.css` > > The only issues I can see are: > > 1. there won't be an easy way to override colors for old browsers (same as > now) > 2. one additional http request > 3. if we ever change (or add/delete) one color we need to remember to > update the variable file > and the CSS > > Do you any feedback on this? I might start a PR during this weekend or the > next one :) > > > [1] https://www.smashingmagazine.com/2017/04/start-using-css > -custom-properties/ > [2] but this is not limited to colors, can be used for fonts, margins, etc > > -- > Patrick Guido Arminio > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/django-developers. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/django-developers/CAOUxZcv836UE3LL26JiZnrd7Mfes8 > _Yf2Cvxbr%2BOe9f2sTyTdg%40mail.gmail.com > <https://groups.google.com/d/msgid/django-developers/CAOUxZcv836UE3LL26JiZnrd7Mfes8_Yf2Cvxbr%2BOe9f2sTyTdg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- Adam -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM3oX9U%3D%2B0U2bVPFN2T6Tb%3DyqqLK9HhfSGZM6ceSv25XxQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
