CSS variables are long time available at server-side via LESS / SASS 
compilers. For example MediaWiki has built-in ResourceLoader that includes 
LESS compiler and JS minifier. It uses caching to re-compile only when 
source .less or .js are changed. Everything works even with IE8. But 
MediaWiki is an "out-of-box use" software not a framework like Django.

When changing colors, most easy way is to use Bootstrap for admin 
templates. In such way, changing colors is as easy as dropping bootstrap 
skin into 'static/css/bootstrap_skin.css' and specifying it with 
Admin.Media subclass css attribute. There are lots of ready bootstrap 3 
skins as well as bootstrap editors. Also it works with old IE and no CSS 
variables are needed (they are compiled separately from Bootstrap source 
code).

On Friday, April 28, 2017 at 3:00:36 PM UTC+3, Collin Anderson wrote:
>
> I suggest supporting IE11+, as that's the latest on Windows 7 and there's 
> not much 9-10 usage. Now's probably a good time to bump them if needed 
> because we're just past an LTS.
>
> Though, yes, it doesn't allow CSS variables.
>
> On Fri, Apr 28, 2017 at 6:38 AM, Curtis Maloney <cur...@tinbrain.net 
> <javascript:>> wrote:
>
>> I recently discovered that the stated "policy" on browser support in 
>> Admin is... well... not clear at all.
>>
>>
>> https://docs.djangoproject.com/en/1.11/faq/admin/#what-browsers-are-supported-for-using-the-admin
>>
>> It claims to support full function for "YUI's A-Grade" browsers, but the 
>> link it provides does nothing to explain the supported versions, and a 
>> further "target environments matrix" link still lists IE6.
>>
>> So perhaps it's time to update the FAQ, and have a discussion on what 
>> Admin's browser support policy needs to be updated to.
>>
>> --
>> Curtis
>>
>> On 28/04/17 19:14, Patrick Guido wrote:
>>
>>> On 27 April 2017 at 23:18, Adam Johnson <m...@adamj.eu <javascript:>
>>> <mailto:m...@adamj.eu <javascript:>>> wrote:
>>>
>>>     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.
>>>
>>> I guess it also depends on use cases, usually (where I work) we tend to
>>> support only latest browsers when it comes to admin, since
>>> it will be used by only a few people :) But I see your point.
>>>
>>> A friend of mine was suggesting configuring colours in python, but this
>>> means that the css would be rendered via python, which is
>>> not ideal.
>>> Another solution would be to add a JS polyfill to make it work on older
>>> browsers, but I'm against it :)
>>> Let's also keep in mind that this (if approved) will be included in
>>> django 2.0 or later, so the browser support will be even better :)
>>>
>>>
>>>     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.
>>>
>>> Uhm, I think we can easily skip one request if the colours have not been
>>> overridden. We can put the vars in base.css.
>>> Then we can add the variables by changing the template (but that's more
>>> cumbersome) either by adding an external css link
>>> or by adding a style tag with the variables.
>>>
>>>
>>>     3. This can be overcome with a test to ensure the two files are in
>>>     sync, I guess?
>>>
>>> Uhm, true!
>>>
>>>
>>>     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?
>>>
>>> I haven't checked all the rules, but I think it will require quite a bit
>>> of work. Maybe we can create a "template" file
>>> that can be used to override quite easily the colours, but that doesn't
>>> scale too well I think.
>>>
>>>
>>> --
>>> 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 django-develop...@googlegroups.com <javascript:>
>>> <mailto:django-developers+unsubscr...@googlegroups.com <javascript:>>.
>>> To post to this group, send email to django-d...@googlegroups.com 
>>> <javascript:>
>>> <mailto:django-d...@googlegroups.com <javascript:>>.
>>> 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/CAOUxZcugkWEnyx3wt7uXNYJE_Rgix-5N_iPwxMbZS73RA63%3DFw%40mail.gmail.com
>>> <
>>> https://groups.google.com/d/msgid/django-developers/CAOUxZcugkWEnyx3wt7uXNYJE_Rgix-5N_iPwxMbZS73RA63%3DFw%40mail.gmail.com?utm_medium=email&utm_source=footer
>>> >.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> -- 
>> 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 django-develop...@googlegroups.com <javascript:>.
>> To post to this group, send email to django-d...@googlegroups.com 
>> <javascript:>.
>> 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/db7742bc-769b-85fe-af87-c398fa99215d%40tinbrain.net
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
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/539961a7-b82a-494c-b177-56d664f0523e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to