Slide 1

Slide 1 text

@stefanjudis Back to boring

Slide 2

Slide 2 text

@stefanjudis stefanjudis.com | webweekly.email Heyo, I'm Stefan!

Slide 3

Slide 3 text

checklyhq.com

Slide 4

Slide 4 text

webweekly.email

Slide 5

Slide 5 text

This is all way too complicated and too much code for a website... My CTO from almost 10 years ago

Slide 6

Slide 6 text

This is how we do it!

Slide 7

Slide 7 text

SPA MPA SSG SSR Edge Rendering (Partial) Hydration Server Components Resumability

Slide 8

Slide 8 text

SPA MPA SSG SSR Edge Rendering (Partial) Hydration Server Components Resumability It's a lot!

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Stefan, welcome to Canada! Access 1 MB of data for 1 Euro! (~1.46 CA$)

Slide 12

Slide 12 text

2013 Hello world! 10KB / 50KB 2023 Hello world! 100KB / 300KB* Complexity * powered by 200MB+ of text files #node_modules

Slide 13

Slide 13 text

cwvtech.report

Slide 14

Slide 14 text

Core Web Vitals Technology Report

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Core Web Vitals Technology Report

Slide 17

Slide 17 text

UX DX My misconception

Slide 18

Slide 18 text

I do feel overwhelmed by the pace of change. [...] JavaScript is meant to feel overwhelming. It’s where we try stu! out. It’s where stu! moves fast. Jeremy Keith Source: "Building" presentation

Slide 19

Slide 19 text

JavaScript CSS HTML HTTP

Slide 20

Slide 20 text

The web platform wasn't ready...

Slide 21

Slide 21 text

The web platform still isn't ready...

Slide 22

Slide 22 text

The web platform still isn't ready... (but we'll get there sooner than later)

Slide 23

Slide 23 text

A cross-browser effort to reach a state where each technology works exactly the same in every browser. Interop Source: wpt.fyi/interop-2023

Slide 24

Slide 24 text

A cross-browser effort to reach a state where each technology works exactly the same in every browser. Interop Source: wpt.fyi/interop-2023

Slide 25

Slide 25 text

Aspect Ratio Cascade Layers Color spaces and functions Dialog Grid Flex Subgrid Containment Scrolling Interop 2022 * * This list is not complete.

Slide 26

Slide 26 text

Container Queries :has() Inert @property Import Maps Font features color-mix :nth-child(of syntax) Interop 2023 * * This list is not complete.

Slide 27

Slide 27 text

open-ui.org

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

How hard can it be to show a tooltip?

Slide 30

Slide 30 text

Floating UI Popper

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

.toggleBtn { anchor-name: -#my-anchor; }

Slide 34

Slide 34 text

.toggleBtn { anchor-name: -#my-anchor; } #something { -#width: 15rem; -#height: 5rem; anchor-default: -#my-anchor; position-fallback: -#left-to-bottom; }

Slide 35

Slide 35 text

.toggleBtn { anchor-name: -#my-anchor; } #something { -#width: 15rem; -#height: 5rem; anchor-default: -#my-anchor; position-fallback: -#left-to-bottom; } @position-fallback -#left-to-bottom { @try { top: calc(anchor(center) - var(-#height) / 2); left: calc(anchor(right)); } @try { top: calc(anchor(center) - var(-#height) / 2); right: calc(anchor(left)); left: auto; } }

Slide 36

Slide 36 text

@position-fallback -#left-to-bottom { @try { top: calc(anchor(center) - var(-#height) / 2); left: calc(anchor(right)); } @try { top: calc(anchor(center) - var(-#height) / 2); right: calc(anchor(left)); left: auto; } } !

Slide 37

Slide 37 text

Popover Anchor Positioning 114 ✅ 17 # 114 $ 117 # % &

Slide 38

Slide 38 text

How hard can it be to write maintainable CSS?

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

1 Variables 2 Color functions 3 Nesting

Slide 41

Slide 41 text

Variables ? Color functions ? Nesting

Slide 42

Slide 42 text

.box { background: PaleVioletRed; } #DB7093 Relative colors

Slide 43

Slide 43 text

.box { -#my-color: PaleVioletRed; background: var(-#my-color); } #DB7093 Relative colors

Slide 44

Slide 44 text

.box { -#my-color: PaleVioletRed; background: rgb(from var(-#my-color) r g b); } rgb(219 112 147) Relative colors

Slide 45

Slide 45 text

.box { -#my-color: PaleVioletRed; background: rgb(from var(-#my-color) r g b); } rgb(219 112 147) Relative colors

Slide 46

Slide 46 text

.box { -#my-color: PaleVioletRed; background: rgb(from var(-#my-color) g r b); } rgb(112 219 147) Relative colors

Slide 47

Slide 47 text

.box { -#my-color: PaleVioletRed; background: rgb(from var(-#my-color) g b r); } rgb(112 147 219) Relative colors

Slide 48

Slide 48 text

.box { -#my-color: PaleVioletRed; background: hsl(from var(-#my-color) h s l); } hsl(340deg 60% 65%) Relative colors

Slide 49

Slide 49 text

.box { -#my-color: PaleVioletRed; background: hsl(from var(-#my-color) h s calc(l + 20%)); } hsl(340deg 60% 85%) Relative colors

Slide 50

Slide 50 text

.box { -#my-color: PaleVioletRed; background: hsl(from var(-#my-color) h 0% calc(l + 20%)); } hsl(340deg 0% 85%) Relative colors

Slide 51

Slide 51 text

.box { -#my-color: PaleVioletRed; background: oklch(from var(-#my-color) calc(l + 0.2) c h); } oklch(0.87 0.13 0.68) Relative colors

Slide 52

Slide 52 text

colorInput.showPicker(); hsl(from #38571a h s 0%) color-contrast(#38571a vs #000, #fff) (behind a flag)

Slide 53

Slide 53 text

Variables Relative colors ? Nesting

Slide 54

Slide 54 text

.card { .container { display: flex; flex-direction: column; gap: 1em; } .header { aspect-ratio: 3 / 2; } & h2, & p { margin: 0; } } Waiting for Firefox 116 (Shipping in ~3 weeks) Photo by Ben Michel on Unsplash

Slide 55

Slide 55 text

.card { .container { display: flex; flex-direction: column; gap: 1em; } .header { aspect-ratio: 3 / 2; } & h2, & p { margin: 0; } } Waiting for Firefox 116 (Shipping in ~3 weeks) ' Photo by Ben Michel on Unsplash

Slide 56

Slide 56 text

Source: developer.chrome.com/articles/css-nesting/

Slide 57

Slide 57 text

.card { h1 {} } .card { & h1 {} } .card { :is(h1) {} } Valid Valid X Invalid

Slide 58

Slide 58 text

How hard can it be to create responsive UI components?

Slide 59

Slide 59 text

.wide-nav { display: none; @media (min-width: 63rem) { display: flex; } }

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Source: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_container_queries

Slide 62

Slide 62 text

.card { .container { display: flex; flex-direction: column; } }

Slide 63

Slide 63 text

.card { container-type: inline-size; .container { display: flex; flex-direction: column; @container (width > 400px) { flex-direction: row; } } }

Slide 64

Slide 64 text

.card { container-type: inline-size; .container { display: flex; flex-direction: column; @container (width > 400px) { flex-direction: row; .header { flex: 0 0 25cqw; } } } }

Slide 65

Slide 65 text

.card { container-type: inline-size; .container { display: flex; flex-direction: column; @container (width > 400px) { flex-direction: row; .header { flex: 0 0 25cqw; } } } } cqw 1% of a query container's width cqh 1% of a query container's height cqi 1% of a query container's inline size cqb 1% of a query container's block size cqmin The smaller value of either cqi or cqb cqmax The larger value of either cqi or cqb

Slide 66

Slide 66 text

.container { container-type: size; height: 12rem; } @container (orientation: portrait) { .portrait { display: grid; } .landscape { display: none; } }

Slide 67

Slide 67 text

.card { container-type: inline-size; .container { display: flex; flex-direction: column; } }

Slide 68

Slide 68 text

.card { container-type: inline-size; .container { display: flex; flex-direction: column; } &:has(img[src*="dog"]) { background: url(./dog.svg); } } Behind a flag

Slide 69

Slide 69 text

article:has(aside) { /% ..' *) } form:has(:invalid) { /% ..' *) } :root:has(.menu-toggle[aria-pressed=”true”]) { /% ..' *) } label:has(+ input) { /% … *) }

Slide 70

Slide 70 text

developer.chrome.com/blog/has-m105/

Slide 71

Slide 71 text

CSS has become a more complete mature language, that works better with the way we build websites today. Una Kravets Source: The state of the CSS community

Slide 72

Slide 72 text

How hard can it be to load a perfect image?

Slide 73

Slide 73 text

Slide 74

Slide 74 text

sizes=" (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em), 550px"> <1picture>

Slide 75

Slide 75 text

<1picture>

Slide 76

Slide 76 text

<1picture> type="image/webp"

Slide 77

Slide 77 text

<1picture> srcset=" https:/0images.ctfassets.net/..'/paris.jpg?w=100&fm=webp 100w, https:/0images.ctfassets.net/..'/paris.jpg?w=200&fm=webp 200w, ..'"

Slide 78

Slide 78 text

<1picture> sizes=" (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em), 550px"

Slide 79

Slide 79 text

<1picture> loading="lazy" sizes=" (max-width: 768px) calc(100vw - 3em), (max-width: 1376px) calc(50vw - 8em), 550px"

Slide 80

Slide 80 text

Kettlebell Swing

Slide 81

Slide 81 text

Kettlebell Swing

Slide 82

Slide 82 text

Kettlebell Swing If images are lazy loaded, let the browser pick the best size.

Slide 83

Slide 83 text

Kettlebell Swing

Slide 84

Slide 84 text

Kettlebell Swing Could this be a thing?

Slide 85

Slide 85 text

How hard can it be to build delightful UI?

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

codepen.io/stefanjudis/pen/abQLvOW

Slide 88

Slide 88 text

function transitionStuff(data) { /0 For non-Chromiums if (!document.startViewTransition) { updateTheDOMSomehow(); return; } /0 browser: ( (old) document.startViewTransition(() =3 { updateTheDOMSomehow(); /0 browser: ( (new) }) }

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

movies.nuxt.space export default defineNuxtConfig({ experimental: { viewTransition: true } })

Slide 93

Slide 93 text

live-transitions.pages.dev

Slide 94

Slide 94 text

Multipage transitions

Slide 95

Slide 95 text

stefanjudis.com

Slide 96

Slide 96 text

smashing-transitions.netlify.app

Slide 97

Slide 97 text

developer.chrome.com/docs/web-platform/view-transitions/

Slide 98

Slide 98 text

The web platform is catching up!

Slide 99

Slide 99 text

JavaScript leads the way to the "next web"...

Slide 100

Slide 100 text

... coming with a better user and developer experience!

Slide 101

Slide 101 text

Video platforms Blogs Shops Image & Illustration software Marketing sites Games Productivity Apps PWAs Streaming sites Social Networks

Slide 102

Slide 102 text

If your site feels like a "boring" Multi Page App, maybe it should be one?

Slide 103

Slide 103 text

If JavaScript doesn't bring users joy, thank it, and throw it away. Marie Kondo

Slide 104

Slide 104 text

If JavaScript doesn't bring users joy, thank it, and throw it away. Marie Kondo Addy Osmani Source: The Cost of JavaScript 2023

Slide 105

Slide 105 text

@stefanjudis stefanjudis.com | webweekly.email Thanks.