What is the most practical way to check for @supports support using only CSS?
@supports
currently only tests property/value combinations, and nothing else. Your other options don't work because none of them are valid (including the last one with just the at-keyword followed by the opening brace!). The property/value pair requirement is dictated by the grammar for @supports
, which you can find in the spec.
Simply test for a property/value pair that you know is guaranteed to work across all user agents whether or not @supports
is implemented. This (sort of) eliminates the possibility that you'll run into a user agent that implements @supports
but not that property/value combination, focusing on its support for @supports
instead.
Your given example of display: block
will suffice. Your use of the cascade to check if a browser does not implement @supports
by overriding declarations within a @supports
rule for browsers that do support it is also acceptable (being the only obvious way to do it anyway).
How to detect if browser support specified css pseudo-class?
You can simply check if your style with pseudo-class was applied.
Something like this: http://jsfiddle.net/qPmT2/1/
Change the dot after a listing to clip
You can do that with :before
and a counter like so:
ol{
list-style-type: none;
counter-reset: listStyle;
}
li{
counter-increment: listStyle;
}
li:before{
content: counter(listStyle, lower-alpha) ") ";
}
<ol>
<li>Foo</li>
<li>Bar</li>
<li>Foo</li>
<li>Bar</li>
</ol>
Site configuration in django-admin
This is what I did. Might not be the most optimal solution but works for me.
Create a Configuration model and do all the usual stuff as in your point 2. Create a function (say in
configuration.view
) which will pull out and return the configuration values in a dict.Now in your
settings.py
, import your function and set the returned dict to asettings.py
variable:CONFIG = configuration.view.get_config()
Create a template context processor which will set this
CONFIG
dict in the template context.def init_site_settings(request):
return settings.CONFIGAdd this context processor to your
TEMPLATE_CONTEXT_PROCESSORS
Now you are free to use your configuration parameters in templates as
{{my_config_key}}
Hope this helps.
Related Topics
Change CSS Variables Dynamically in Angular
Did Chrome 72 Break 'Data:Image/Svg+Xml;Utf8' for CSS Background Svgs
CSS Sprite Techniques, CSS Background or Img's Clip
Overriding CSS on Github Pages Using Slate Theme
Using CSS Selectors to Access Specific Table Rows with Selenium
Can a CSS Pseudo-Class Be Namespaced
Vertical-Align and Inline-Block Behaving Annoyingly Different in Chrome and Firefox
Why Are My Google Web Fonts Pixelated
Nested Div with Margin Top Set Causes Scrollbar to Appear
How to Customize Responsive Columns and Inputs Fields in Twitter Bootstrap
Bootstrap 3 Multiselect Plugin as Form Element
Floated Image to Left of a Ul Is Ignoring Margin/Padding
Fixed Width Variable Height Grid CSS
Alternative to Inline-Block and Its Support with Current Browsers