File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket.
99
1010For a steady stream of TILs, [ sign up for my newsletter] ( https://tinyletter.com/jbranchaud ) .
1111
12- _ 887 TILs and counting..._
12+ _ 888 TILs and counting..._
1313
1414---
1515
@@ -99,6 +99,7 @@ _887 TILs and counting..._
9999- [ Apply Styles To The Last Child Of A Specific Type] ( css/apply-styles-to-the-last-child-of-a-specific-type.md )
100100- [ Change The Orientation Of An Image] ( css/change-the-orientation-of-an-image.md )
101101- [ Circular Icons With A Massive Border Radius] ( css/circular-icons-with-a-massive-border-radius.md )
102+ - [ Conditional Styling For Unsupported CSS Features] ( css/conditional-styling-for-unsupported-css-features.md )
102103- [ Create A Pulsing Background With CSS Animation] ( css/create-a-pulsing-background-with-css-animation.md )
103104- [ Dry Up SCSS With Mixins] ( css/dry-up-scss-with-mixins.md )
104105- [ Give Elements The Same Width With Flexbox] ( css/give-elements-the-same-width-with-flexbox.md )
Original file line number Diff line number Diff line change 1+ # Conditional Styling For Unsupported CSS Features
2+
3+ As much as possible, you should aim to use CSS features that have broad browser
4+ support. Sometimes browsers lag behind or you'd like to take advantage of a
5+ draft feature in browsers that support it.
6+
7+ For these situations, you can provide conditional styling using the
8+ [ ` @supports `
9+ at-rule] ( https://developer.mozilla.org/en-US/docs/Web/CSS/@supports ) .
10+
11+ Here is an example of conditionally using ` display: grid ` if it is supported:
12+
13+ ``` css
14+ @supports (display : grid ) {
15+ div {
16+ display : grid ;
17+ }
18+ }
19+ ```
20+
21+ In [ this
22+ article] ( https://24ways.org/2019/zs-still-not-dead-baby-zs-still-not-dead/ )
23+ there is an example of using ` background-blend-mode ` and falling back to
24+ ` background-image ` if it isn't supported.
25+
26+ ``` css
27+ @supports not (background-blend-mode : normal ) {
28+ body {
29+ background-image : url (fallback.png );
30+ }
31+ }
32+ ```
You can’t perform that action at this time.
0 commit comments