« resources

Smashing Workshop

Modern & Resilient

managing support across the platform

workshops.oddbird.net/smashing24/resilient/

Cmd/Ctr-K for Controls

CSS is Resilient

CSS Errors Silently

ReferenceError Variable is not defined

SyntaxError Missing } after property list

Error recovery using ; and (matched) }; [present, debug]

A feature Of CSS (& HTML)

Always Display the Content

Then style it if possible

New Features!

Style Queries Are Cool!

Style Queries Have Support??

Hand written note says I like you, do you like me?
Support data from CanIUse.com on the css-container-queries-style feature
[Can I Use]
X's, checks, and question marks scribbled all over the note in random red and green variations
70.35% Partial???

Browser Support is Not A Binary

Arbitrary Cutoff? 95% ? 100% ? Last Two ?

screenshot
[Features with 100% browser support are capped at 97.98%]

CanIUse Caveats and Settings

  • See ‘settings’

Also… MDN

Mozilla Developer Network

Support stats Are Updated Manually

Usage stats Vary Widely

Also… Web Platform Tests

File and Follow Browser Issues

We Already Know How To Do This

Responsive ➡ Resilient

Consider… Features Not Browsers

Not Re-Writing For Every Viewport

[Viewport Sizes]
avatar

If you have to entirely re-engineer for IE… you’re Doing It Wrong.

— Natalie Downe, CSS Systems

Don’t Assume Correlations

Re-Define What ‘Support’ Means

Not identical, but equivalent

avatar

There is a difference between support and optimization.

— Brad Frost, support vs optimization (2011)

Start from Your Baseline Functionality

avatar
  1. Identify core functionality.
  2. Make that functionality available using the simplest possible technology.
  3. Enhance!

— Jeremy Keith, Resilient Web Design

This is… Progressive Enhancement

avatar

You can use it and not use it at the same time, because it works and it doesn’t work at the same time. It’s Quantum CSS! It’s Magic!

— Jen Simmons, Intro to Resilient CSS

Tools Keep Getting Better

css…
/* IE6 and below */
* html #uno  { color: red }

/* IE7 */
*:first-child+html #dos { color: red }

/* IE7, FF, Saf, Opera  */
html>body #tres { color: red }

/* IE8, FF, Saf, Opera (Everything but IE 6,7) */
html>/**/body #cuatro { color: red }
Selector Hacks (from 2004)
css…
.no-cssgradients .header {
  background: url("images/glossybutton.png");
}

.cssgradients .header {
  background-image: linear-gradient(deeppink, rebeccapurple);
}
2009, Modernizr for CSS3

Now… @media & @supports

Now… Evergreen Browsers

Browser testing Is Excellent Practice

Browser testing Is Required Constantly

Sort issues By Impact Priority

Some issues… No Fallback Needed

No Fallback [present, debug]
screenshot
Dave Rupert [Getting started with View Transitions]

Some issues… Silent Fallback

Order of Appearance

Is a progressive-enhancement feature

Subgrid Form [present, debug]
Headshot of Jen Simmons.

Jen Simmons Resilient Videos

Wide Gamut Colors (fallback) [present, debug]

Support Queries

MDN Page
Wide Gamut Colors (v2) [present, debug]

Selector Queries

MDN Page
Selector Fallback :has() [present, debug]

Preference Queries

MDN Page

@media Not Just Print & Viewport Sizes

prefers-color-scheme

light | dark | no-preference

prefers-contrast

low | high | no-preference

prefers-reduced-motion

reduce | no-preference

prefers-reduced-transparency

reduce | no-preference

Media Prefers… [present, debug]

Reduced Motion

Not reduced animation

Reduced Motion [present, debug]

Media Features

MDN Page

Combining Hover & Pointer Media

css…
/* touch screens */
@media (hover: none) and (pointer: coarse) { }

/* stylus-based screens */
@media (hover: none) and (pointer: fine) { }

/* gesture-based screens */
@media (hover: hover) and (pointer: coarse) { }

/* mouse & touch pad */
@media (hover: hover) and (pointer: fine) { }

How do you sell this To The Boss or Client?

We Don’t

It’s just the job we do

The web Is For People

Those people Rely On Our Services

We build The Interfaces

Our job is Making it Usable

We're Not Alone, with browser logos, a guy in construction clothes carrying a laptop, and ET
  • To build a web that’s world wide
  • We all have to do our part

We don’t need to Optimize For Every Browser

We do need to Support Our Users

ET and the kids flying their bicycles across the sunset
  • They’re just trying to get home
  • Aren’t we all?
« resources

Smashing Workshop

Modern & Resilient

Bring this workshop to your company.
Slide Controls

View:

Navigate slides using the arrow-keys.