Chapter 5
CSS3 – Selectors, Typography, and Color Modes
Section 4
Facilitating Feature Forks in CSS
When you're building a responsive web design, attempting to provide a single design that works everywhere, on every device, it's a simple fact that you'll frequently encounter situations when features or techniques are not supported on certain devices. In those instances, you'll likely want to create a fork in your CSS: if the browser supports a feature, provide one chunk of code; if it doesn't, it gets different code. It's the kind of situation that gets handled by if…else or switch statements in JavaScript. We currently have two possible approaches. One is entirely CSS-based but with fewer browser implementations, and the other is only made possible with the help of a JavaScript library but enjoys far broader support. Let's consider each in turn. This video covers: - Demo on Featuring Queries - Demo on Combining Conditionals - Modernizr - Demo on Feature Detection with Modernizr