Get AI summaries of any video or article — Sign up free
21 Awesome Web Features you’re not using yet thumbnail

21 Awesome Web Features you’re not using yet

Fireship·
5 min read

Based on Fireship's video on YouTube. If you like this content, support the original creators by watching, liking and subscribing to their content.

TL;DR

Use the native <dialog> element with showModal() and close() to build modals without custom backdrop/visibility JavaScript.

Briefing

Native HTML dialog and popover are turning two long-standing UI patterns—modals and lightweight overlays—into first-class browser features. Instead of building modal backdrops and visibility logic with custom JavaScript and brittle CSS, developers can use the <dialog> element and its built-in showModal() and close() methods. The backdrop is stylable via CSS pseudo-elements, and closing can happen through form submission inside the dialog or by calling close() from other events. Popovers follow a similar direction: an experimental attribute-driven API (popoverTargetElement and popover) lets developers show and hide content without hand-rolled JS or focus-trap gymnastics, as long as the popover target matches the element ID.

The biggest “platform shift” on the list is WebGPU, positioned as the successor to WebGL and the route for browsers to tap GPUs directly. Even under an experimental flag, the ecosystem is already moving: BabylonJS supports it, 3D support in Three.js is underway, and TensorFlow.js is also aligning with WebGPU. That combination points to faster 3D graphics and games on the web, plus the ability for end users to train machine learning models in-browser without downloading Python toolchains or relying on cloud notebooks.

Responsive design gets a major upgrade with container queries, which target the size of an element’s parent container rather than the viewport. Developers define a containment context using container-type, then use container queries to apply styles based on the nearest ancestor container. New units such as container query width and height reduce the need for JavaScript-based bounding-box calculations. Tailwind also has an official container queries package to declare these containers directly in markup.

CSS ergonomics and expressiveness keep expanding. CSS nesting reduces duplicated selectors by allowing rules to be written inside parent blocks. Color mix brings native color interpolation into CSS using a function that blends two colors in a chosen color space, enabling multi-element gradient effects without external tooling. Color fonts (chromatic fonts) allow multiple colors inside a single glyph, enabling effects like 3D gradients while still behaving like regular fonts in the browser.

Performance tooling is getting more direct. A new Web Vitals plugin for Chrome aims to log performance metrics as a site is used, helping pinpoint issues such as layout shift and identify the exact element responsible—faster than the slower, more manual Lighthouse workflow.

JavaScript and CSS also gain practical capabilities. JavaScript’s at() indexing makes “last element” access straightforward with at(-1) and at(-2). structured clone replaces the common JSON stringify/parse hack for deep copying objects, preserving new references in memory. On the CSS side, new transform properties simplify scale/translate/rotate adjustments, trig functions like sine/cosine/tangent support more math-driven layouts, and initial-letter helps style the first letter of articles like magazine drop caps. Mobile-focused viewport units account for browser UI changes, and Focus Visible improves accessible focus handling.

Finally, two emerging browser APIs target richer motion and app-like navigation: the View Transitions API animates between page states to keep users in context, while the Animation Timeline API (experimental) ties animation control to scroll position—turning a common “scroll-driven animation” pattern into something more controllable than today’s ad-hoc approaches.

Cornell Notes

The core message is that modern web development is gaining first-class browser features that reduce custom JavaScript/CSS work and unlock new capabilities. Native <dialog> and popovers make modals and overlays easier to build with built-in show/close behavior and attribute-driven targeting. WebGPU is highlighted as the major platform step, enabling faster 3D graphics and in-browser ML workloads through libraries like BabylonJS and TensorFlow.js. Container queries shift responsive styling from viewport-based media queries to parent-container-based rules, improving layout correctness. JavaScript and CSS also get quality-of-life upgrades like at() indexing and structured clone for deep copying, plus CSS nesting, color mix, and chromatic fonts for more expressive styling.

How do native HTML dialog and popover change the way modals and overlays are built?

With <dialog>, developers can reference the element by ID and call showModal() to display it with an automatic backdrop. Closing can happen via a form submission inside the dialog using dialog methods, or by calling close() from other events. The backdrop can be styled using CSS pseudo-elements, and CSS transitions can animate the dialog. Popovers take a different approach: an experimental, attribute-based API uses popoverTargetElement and popover to show/hide content without custom JavaScript or tricky CSS, relying on matching IDs for targeting and built-in focus behavior.

Why is WebGPU treated as the most important item, even though it’s experimental?

WebGPU is positioned as the successor to WebGL, letting browsers and web apps use GPUs more directly. That matters for both graphics and computation: 3D libraries such as BabylonJS already support it, and Three.js support is underway, pointing to faster web games and 3D rendering. On the ML side, TensorFlow.js support suggests end users could train models in-browser without downloading Python dependencies or using cloud notebooks.

What problem do container queries solve compared with media queries?

Media queries respond to viewport size, but many UI decisions depend on the size of an element’s parent container. Container queries let developers define a containment context with container-type, then apply styles using container rules based on the nearest ancestor container. New units like container query width/height help compute child sizing directly in CSS, reducing the need for JavaScript bounding-box measurements and complex calculations.

What are the practical benefits of CSS nesting, color mix, and chromatic (color) fonts?

CSS nesting improves readability and reduces duplicated selectors by allowing rules to be written inside parent blocks. Color mix adds a native function to blend two colors in a chosen color space, enabling effects like multi-element gradients without external preprocessing. Chromatic fonts (color fonts) embed multiple colors within a single glyph, enabling palette-driven visual effects (including 3D gradient-like looks) while still rendering as regular fonts in the browser.

Which JavaScript features reduce common pain points around array indexing and deep copying?

The at() method enables direct indexing from the end: at(-1) returns the last element and at(-2) the second-to-last, eliminating the length-minus-one pattern. For deep copying, structured clone provides a global function to clone objects into a new reference. That avoids the older JSON stringify/parse workaround, which was widely used to force a new object reference but is considered a hack.

What emerging browser APIs aim to make navigation and scroll animations feel more like mobile apps?

The View Transitions API enables animations between page states so users stay oriented during navigation. The Animation Timeline API (experimental) allows animation control based on scroll position, targeting the common but often complicated “scroll-driven animation” pattern with a more direct mechanism.

Review Questions

  1. Which built-in methods and CSS hooks does <dialog> provide for showing, closing, and styling modal backdrops?
  2. How do container queries determine when to apply styles, and what replaces viewport-based media queries in that approach?
  3. Why is structured clone considered a better deep-copy mechanism than JSON stringify/parse?

Key Points

  1. 1

    Use the native <dialog> element with showModal() and close() to build modals without custom backdrop/visibility JavaScript.

  2. 2

    Adopt the experimental popover API to show and hide overlay content using popoverTargetElement and popover attributes rather than bespoke JS/CSS.

  3. 3

    Plan for WebGPU as the next major graphics and compute layer, with ecosystem support from libraries like BabylonJS and TensorFlow.js.

  4. 4

    Replace viewport-driven media queries with container queries when layout decisions depend on parent element size, using container-type and container query rules.

  5. 5

    Simplify JavaScript indexing and deep copying with at(-1)/at(-2) and structured clone instead of length-minus-one and JSON stringify/parse hacks.

  6. 6

    Leverage CSS nesting, color mix, and chromatic fonts to reduce selector duplication and create richer visual effects using native browser capabilities.

  7. 7

    Use Chrome’s Web Vitals plugin to log performance metrics during real browsing and quickly identify elements tied to issues like layout shift.

Highlights

Native <dialog> turns modal construction into an ID-referenced element with showModal() and close(), plus a CSS-stylable backdrop.
WebGPU is framed as WebGL’s successor, with momentum from BabylonJS and TensorFlow.js that could accelerate both 3D and in-browser ML.
Container queries shift responsive design from viewport size to parent container size, using container-type and container query rules.
structured clone replaces the JSON stringify/parse deep-copy workaround by producing a new object reference directly.
View Transitions and Animation Timeline aim to make navigation and scroll-driven motion feel more app-like.

Topics

  • Native Dialog
  • WebGPU
  • Container Queries
  • CSS Nesting
  • Structured Clone

Mentioned