back to module

Smashing Workshop

Modern & Resilient

Arrows navigate, cmd/ctrl-k for settings

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?
CanIUse css-container-queries-style credit: caniuse.bitsofco.de
CanIUse css-container-queries-style
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 ?

Features with 100% browser support _are capped at 97.98%_
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: permalink
avatar

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

— Natalie Downe, CSS Systems
2008

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

Headshot of Jeremy Keith.
  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

Headshot of Jen Simmons, smiling

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
Getting started with View Transitions
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, smiling

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?
SlideDeck Controls

View

Keyboard shortcuts
cmd/ctrl-k:
Toggle this control dialog
cmd/ctrl-shift-enter:
presentation (from first slide)
cmd/ctrl-enter:
presentation (from active slide)
alt-enter:
in speaker view (following active slide)

Color Settings