I didn’t know CSS could do that!

A presentation at DevFest Alps 2024 in in Turin, Metropolitan City of Turin, Italy by Matteo Fogli

I didn't know CSS could do that!

I didn't know CSS could do that!

Hello there

Hello there

So what’s new with CSS?

So what’s new with CSS?

A lot:

A lot:

Enter Baseline

Enter Baseline

How do features become part of Baseline?

How do features become part of Baseline?

How do features become part of Baseline?

How do features become part of Baseline?

Interop (2024)

Interop (2024)

Is this because you hate JavaScript?

Is this because you hate JavaScript?

But why work against the browser?

But why work against the browser?

The Principle of Least Power

The Principle of Least Power

Complex conditional DOM states

Complex conditional DOM states

The parent selector

The parent selector

The basics

The basics

The not so basics

The not so basics

Change parent element based on child:hover

Change parent element based on child:hover

Change parent element based on content

Change parent element based on content

Change previous sibling

Change previous sibling

Baseline Newly Available

Baseline Newly Available

Feature detection

Feature detection

:has caveats and usage hints

:has caveats and usage hints

The “range” selector

The “range” selector

`:nth-child(n + B)` `:nth-child(-n + B)`

`:nth-child(n + B)` `:nth-child(-n + B)`

:nth-child(An + B of .selector)

:nth-child(An + B of .selector)

:nth-child(An + B of .selector)

:nth-child(An + B of .selector)

of <selector> Baseline Newly Available

of <selector> Baseline Newly Available

Typographically accurate text wrapping

Typographically accurate text wrapping

`text-wrap: balance`

`text-wrap: balance`

`text-wrap: pretty`

`text-wrap: pretty`

Baseline Newly Available

Baseline Newly Available

Feature detection

Feature detection

Scroll driven animations

Scroll driven animations

scroll-driven-animations.style

scroll-driven-animations.style

Scroll driven animations extend CSS animations

Scroll driven animations extend CSS animations

Scroll driven animations extend CSS animations

Scroll driven animations extend CSS animations

`scroll()`

`scroll()`

scroll()

scroll()

`view()`

`view()`

Measure direction and velocity…

Measure direction and velocity…

… for unthinkable CSS-only effects

… for unthinkable CSS-only effects

Baseline? not yet

Baseline? not yet

Feature detection

Feature detection

It&#039;s all about CSS

It's all about CSS

I didn&#039;t know CSS could do that!

I didn't know CSS could do that!

I didn&#039;t I could do that with CSS!

I didn't I could do that with CSS!

Thank you

Thank you

Over the years CSS has evolved a lot, with incredible new features covering animation, layout, color, programmability. CSS has eaten away a lot of ground from Javascript, making natively available to devs and users features that were once Javascript only, saving computation cycles along the way, allowing for progressive enhancement and favouring accessibility and web performance. This talk will show you what CSS can do that you thought you had to reach JS for.

Resources

The following resources were mentioned during the presentation or are useful additional information.