Browser Support And The Rapidly Changing Web

A presentation at iJS Munich in November 2024 in Hochstraße 3, 81669 München, Germany by Rachel Andrew

Slide 1

Slide 1

Browser support and the rapidly changing web

Slide 2

Slide 2

Rachel Andrew Content lead for Chrome Developer Relations CSS Working Group member rachelandrew.co.uk

Slide 3

Slide 3

It’s an exciting time to be a front-end developer

Slide 4

Slide 4

appearance, Array at(), ::backdrop, background-attachment, BroadcastChannel, cascade layers, containment, <dialog>, :focusvisible, hwb(), dynamic-range media query, prefers-contrast media query, Streams API, contain: style, Individual transforms, Array findLast() and findLastIndex(), :modal pseudo-class, Permissions API, overscroll-behavior, overflow property, offset property, forced-colors media query, Inline-size containment, ic unit, grid animation, font-palette CSS property, small, large, and dynamic viewport units, WebGL OES_draw_buffers_indexed extension, MathML, :autofill pseudo, container queries, color-gamut media query, CSS trigonometric functions, font-variant-alternates, translate attribute, OPFS, Wasm SIMD, Imperative slot assignment, serverTiming, Screen orientation, Resource size, requestAnimationFrame() in workers, Push messages, CSS outline shorthand, OffscreenCanvas API, messageerror, media query range syntax, input (event), Import maps, Form-associated custom elements, font-synthesis properties, Fetch metadata, Constructed stylesheets, inert attribute, Canvas roundRect(), Canvas createConicGradient(), WebRTC SCTP information, New CSS color spaces, nth-child() of <selector>, Compression Streams, CSS color-mix(), CSS color(), window.print(), JavaScript modules in workers, calc() constants, Array by copy, animation-composition property, Two-values of CSS Display, dirname attribute, CSS Grid subgrid, font-variant-position Update frequency media query, Overflow media queries, <link rel=”modulepreload”>, image-set(), CSS hyphens property, Device orientation events, CSS @counterstyle, contain-intrinsic-style, HTML <search> element, Web Authn easy public key access, isWellFormed() and toWellFormed(), ARIA attribute reflection, :user-valid and :user-invalid, clip-path boxes, User activation API, lh unit, Storage access, URL.canParse(), Scripting media query, CSS mask property, CSS exponential functions, :dir pseudo-class, background-clip: text, preservesPitch property, rel=”preload” for responsive images, CSS Nesting, CSS linear() easing, counter-set, CSS cap unit, Canvas reset(), loading=”lazy” for <img> and <iframe>, :has(), Array.fromAsync, AVIF, Declarative shadow DOM, Transferable ArrayBuffer, Promise.withResolvers(), checkVisibility(), Array grouping, white-space-collapse, text-wrap: nowrap, AbortSignal.any(), CSS transform-box, Intl.Segmenter, Vertical form controls, text-wrap: balance, light-dark(), zoom, :state(), round(), mod(), rem(), Set methods, Gradient interpolation, Async clipboard API, Resizable ArrayBuffers, CSS Relative colors, @property, Unsanitized HTML parsing methods, alt text for generated content, font-size-adjust, transition-behavior, mutually exclusive details elements, contentvisibility, Canvas willReadFrequently,backdrop-filter Newly interoperable features for the web platform 2022-2024

Slide 5

Slide 5

Interoperable Features available in the major browser engines.

Slide 6

Slide 6

The Interop project Working together to make the web more interoperable.

Slide 7

Slide 7

https://wpt.fyi/interop-2024

Slide 8

Slide 8

Interop 2024 stable scores as of 13 Nov 2024.

Slide 9

Slide 9

cascade layers, containment, <dialog>, hwb(), contain: style, individual transforms, overscroll-behavior, offset property, inline-size containment, font-palette CSS property, container queries, translate attribute, OffscreenCanvas API, formassociated custom elements, constructed Stylesheets, inert attribute, new CSS color spaces, nth-child() of <selector>, CSS grid subgrid, :user-valid and :user-invalid, CSS mask property, CSS nesting, :has(), Declarative Shadow DOM, textwrap: balance, round(), mod(), rem(), CSS relative colors, @property, font-size-adjust, transition-behavior Some of the features helped to interoperability by Interop

Slide 10

Slide 10

How do I know when a feature is ready to use? Is it in all browsers? How long should I wait to use it once it’s in browsers?

Slide 11

Slide 11

This is not a new problem Rapid release cycles have made it harder. In the past we often tied our version of the web to which version of Internet Explorer things worked in.

Slide 12

Slide 12

https://web-platform-dx.github.io/web-features/

Slide 13

Slide 13

Supported in: • • • • Apple Safari (macOS and iOS) Google Chrome (desktop and Android) Microsoft Edge (desktop) Mozilla Firefox (desktop and Android)

Slide 14

Slide 14

A feature is classed as Widely available once 30 months have passed since it became Newly available.

Slide 15

Slide 15

A feature is classed as Limited availability if it is unavailable in one or more of the core browsers.

Slide 16

Slide 16

appearance, Array at(), ::backdrop, backgroundattachment, BroadcastChannel, cascade layers, containment, <dialog>, :focus-visible, hwb(), dynamicrange media query Baseline Widely available features from early 2022

Slide 17

Slide 17

prefers-contrast media query, Streams API, contain: style, Individual transforms, Array findLast() and findLastIndex(), :modal pseudo-class, Permissions API, overscroll-behavior, overflow property, offset property, forced-colors media query, Inline-size containment, ic unit, Grid animation, font-palette CSS property, Small, large, and dynamic viewport units, WebGL OES_draw_buffers_indexed extension, MathML, :autofill pseudo, Container queries, color-gamut media query, CSS trigonometric functions, font-variant-alternates, translate attribute, OPFS, Wasm SIMD, Imperative slot assignment, serverTiming, Screen orientation, Resource size, requestAnimationFrame() in workers, Push messages, CSS outline shorthand, OffscreenCanvas API, messageerror, Media query range syntax, input (event), Import maps, Form-associated custom elements, font-synthesis properties, Fetch metadata, Constructed stylesheets, Inert attribute, Canvas roundRect(), Canvas createConicGradient(), WebRTC SCTP information, New CSS color spaces, nth-child() of <selector>, Compression Streams, CSS color-mix(), CSS color(), window.print(), JavaScript modules in workers, calc() constants, Array by copy, animation-composition property, Two-values of CSS Display, dirname attribute, CSS Grid subgrid, font-variant-position Update frequency media query, Overflow media queries, <link rel=”modulepreload”>, image-set(), CSS hyphens property, Device orientation events, CSS @counter-style, contain-intrinsic-style, HTML <search> element, Web Authn easy public key access, isWellFormed() and toWellFormed(), ARIA attribute reflection, :user-valid and :user-invalid, clip-path boxes, User activation API, lh unit, Storage access, URL.canParse(), Scripting media query, CSS mask property, CSS exponential functions, :dir pseudo-class, background-clip: text, preservesPitch property, rel=”preload” for responsive images, CSS Nesting, CSS linear() easing, counter-set, CSS cap unit, Canvas reset(), loading=”lazy” for <img> and <iframe>, :has(), Array.fromAsync, AVIF, Declarative shadow DOM, Transferable ArrayBuffer, Promise.withResolvers(), checkVisibility(), Array grouping, white-space-collapse, text-wrap: nowrap, AbortSignal.any(), CSS transform-box, Intl.Segmenter, Vertical form controls, text-wrap: balance, light-dark(), zoom, :state(), round(), mod(), rem(), Set methods, Gradient interpolation, Async clipboard API, Resizable ArrayBuffers, CSS Relative colors, @property, Unsanitized HTML parsing methods, Alt text for generated content, font-size-adjust, transition-behavior, Mutually exclusive details elements, content-visibility, Canvas willReadFrequently,backdrop-filter Basline Newly available 2022-2024

Slide 18

Slide 18

The mission of the WebDX Community Group is to facilitate coordinated approaches to improve the overall experience of developing for the web platform. WebDX Community Group Charter https://github.com/web-platform-dx/admin/blob/main/charter.md

Slide 19

Slide 19

Baseline <year> For the first time we can view an annual release of the web platform.

Slide 20

Slide 20

appearance, Array at(), ::backdrop, background-attachment, BroadcastChannel, cascade layers, containment, <dialog>, :focus-visible, hwb(), dynamic-range media query, preferscontrast media query, Streams API, contain: style, Individual transforms, Array findLast() and findLastIndex(), :modal pseudo-class, Permissions API, overscroll-behavior, overflow property, offset property, forced-colors media query, Inlinesize containment, ic unit, grid animation, font-palette CSS property, small, large, and dynamic viewport units, WebGL OES_draw_buffers_indexed extension, Baseline 2022

Slide 21

Slide 21

MathML, :autofill pseudo, Container queries, color-gamut media query, CSS trigonometric functions, font-variant-alternates, translate attribute, OPFS, Wasm SIMD, Imperative slot assignment, serverTiming, Screen orientation, Resource size, requestAnimationFrame() in workers, Push messages, CSS outline shorthand, OffscreenCanvas API, messageerror, Media query range syntax, input (event), Import maps, Form-associated custom elements, font-synthesis properties, Fetch metadata, Constructed stylesheets, Inert attribute, Canvas roundRect(), Canvas createConicGradient(), WebRTC SCTP information, New CSS color spaces, nth-child() of <selector>, Compression Streams, CSS colormix(), CSS color(), window.print(), JavaScript modules in workers, calc() constants, Array by copy, animation-composition property, Two-values of CSS Display, dirname attribute, CSS Grid subgrid, fontvariant-position Update frequency media query, Overflow media queries, <link rel=”modulepreload”>, image-set(), CSS hyphens property, Device orientation events, CSS @counter-style, contain-intrinsicstyle, HTML <search> element, Web Authn easy public key access, isWellFormed() and toWellFormed(), ARIA attribute reflection, :user-valid and :user-invalid, clip-path boxes, User activation API, lh unit, Storage access, URL.canParse(), Scripting media query, CSS mask property, CSS exponential functions, :dir pseudo-class, background-clip: text, preservesPitch property, rel=”preload” for responsive images, CSS Nesting, CSS linear() easing, counter-set, CSS cap unit, Canvas reset(), loading=”lazy” for <img> and <iframe>, :has() Baseline 2023

Slide 22

Slide 22

Array.fromAsync, AVIF, Declarative shadow DOM, Transferable ArrayBuffer, Promise.withResolvers(), checkVisibility(), Popover, Array grouping, white-space-collapse, text-wrap: nowrap, AbortSignal.any(), CSS transform-box, Intl.Segmenter, Vertical form controls, text-wrap: balance, light-dark(), zoom, :state(), round(), mod(), rem(), Set methods, gradient interpolation, Async clipboard API, Resizable ArrayBuffers, CSS Relative colors, @property, Unsanitized HTML parsing methods, Alt text for generated content, font-size-adjust, transition-behavior, mutually exclusive details elements, contentvisibility, Canvas willReadFrequently,backdrop-filter Baseline 2024

Slide 23

Slide 23

align-content for block layout Vertically center an item without using flex or grid

Slide 24

Slide 24

.center { display: flex; align-content: center; block-size: 300px; }

Slide 25

Slide 25

.center { align-content: center; block-size: 300px; } https://codepen.io/web-dot-dev/pen/mdNEgvj

Slide 26

Slide 26

https://codepen.io/web-dot-dev/pen/mdNEgvj

Slide 27

Slide 27

@property Define type, default values, and inheritance for CSS custom properties

Slide 28

Slide 28

@property —bgcolor { syntax: “<color>”; inherits: false; initial-value: #ee4b6a; }

Slide 29

Slide 29

.box { background-color: var(—bgcolor); } https://codepen.io/web-dot-dev/pen/gOVMJbZ

Slide 30

Slide 30

.box2 { —bgcolor: #0f7173; background-color: var(—bgcolor); } https://codepen.io/web-dot-dev/pen/gOVMJbZ

Slide 31

Slide 31

.box3 { —bgcolor: 1; background-color: var(—bgcolor); } https://codepen.io/web-dot-dev/pen/gOVMJbZ

Slide 32

Slide 32

https://web.dev/blog/at-property-baseline

Slide 33

Slide 33

Size container queries Query the size of the container instead of the viewport.

Slide 34

Slide 34

https://codepen.io/web-dot-dev/pen/dyxXxjV

Slide 35

Slide 35

https://codepen.io/web-dot-dev/pen/dyxXxjV

Slide 36

Slide 36

.wrapper { container-type: inline-size; } @container (min-width: 500px) { .card { display: grid; grid-template-columns: 0.8fr 1fr; gap: 10px; } } https://codepen.io/web-dot-dev/pen/dyxXxjV

Slide 37

Slide 37

:has() A parent selector—and much more

Slide 38

Slide 38

Slide 39

Slide 39

@container (min-width: 500px) { .card:has(figure + .content) { display: grid; grid-template-columns: 0.8fr 1fr; gap: 10px; } } https://codepen.io/web-dot-dev/pen/MWNjojQ

Slide 40

Slide 40

https://codepen.io/web-dot-dev/pen/MWNjojQ

Slide 41

Slide 41

text-wrap: balance Making headlines more beautiful

Slide 42

Slide 42

h2 { text-wrap: balance; } https://codepen.io/web-dot-dev/pen/vYoXZeO

Slide 43

Slide 43

https://codepen.io/web-dot-dev/pen/vYoXZeO

Slide 44

Slide 44

New color spaces sRGB Linear,LCH, okLCH, LAB, okLAB, Display p3, Rec2020, a98 RGB, ProPhoto RGB, XYZ, XYZ d50, XYZ d65

Slide 45

Slide 45

New color functions color(), lch(), lab(), oklch(), oklab()

Slide 46

Slide 46

https://developer.chrome.com/docs/css-ui/access-colors-spaces

Slide 47

Slide 47

gradient.style

Slide 48

Slide 48

color-mix() Mix teo colors in CSS using any color space.

Slide 49

Slide 49

li { background-color: color-mix(in srgb, #34c9eb 10%, white); } https://codepen.io/web-dot-dev/pen/LYwbVdd

Slide 50

Slide 50

https://codepen.io/web-dot-dev/pen/LYwbVdd

Slide 51

Slide 51

How do we know what’s in Baseline? Introducing web features: mapping the web platform as a series of features.

Slide 52

Slide 52

https://github.com/web-platform-dx/web-features/

Slide 53

Slide 53

https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow#browser_compatibility

Slide 54

Slide 54

https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow#browser_compatibility

Slide 55

Slide 55

Explain browser support to stakeholders “Everything in <project> will be Baseline Widely available”

Slide 56

Slide 56

https://browsersupport.clearleft.com/

Slide 57

Slide 57

Adopt a Baseline year My shiny framework v.1 uses Baseline 2022, v.2 moves to Baseline 2023.

Slide 58

Slide 58

Use Baseline to see what’s new Find out what features have come to the platform, create a list to learn about.

Slide 59

Slide 59

https://web-platform-dx.github.io/web-features-explorer/

Slide 60

Slide 60

https://webstatus.dev

Slide 61

Slide 61

Show feature status in talks, articles, and blog posts Use the Baseline status component on posts or logos on slides

Slide 62

Slide 62

https://web.dev/blog/font-size-adjust

Slide 63

Slide 63

https://github.com/web-platform-dx/baseline-status

Slide 64

Slide 64

<baseline-status featureId=”font-size-adjust”></baseline-status> https://github.com/web-platform-dx/baseline-status

Slide 65

Slide 65

Use the Baseline logos! https://web-platform-dx.github.io/web-features/name-and-logo-usage-guidelines/

Slide 66

Slide 66

https://web-platform-dx.github.io/web-features/baseline-in-the-wild/

Slide 67

Slide 67

Baseline in developer tools Where can we use this data?

Slide 68

Slide 68

https://rumarchive.com/insights/#baseline

Slide 69

Slide 69

Get involved! https://web-platform-dx.github.io/web-features/

Slide 70

Slide 70

Thank you Rachel Andrew https://noti.st/rachelandrew/PGuk8T/