Smashing Magazine - #479: New Front-End Adventures In 2025

CSS style queries, auto field-sizing for forms, simpler snapping, anchor positioning, smooth transitions with View Transitions API. Issue #479 Oct 22, 2024 View in the browser

Smashing Newsletter

Hej Smashing Friends,

As we are moving towards 2025, it’s good time to revisit what’s new in front-end. We’ll be running an online workshop on New Front-End Adventures in 2025 in early January. We’ll dive into everything from anchor positioning to accessibility to Interaction To Next Paint (INP). Get an early-bird ticket.

In this newsletter, we explore some of these technologies — field-sizing, CSS style queries, snapping and View Transitions API — working beautifully in modern browsers. Hopefully, you’ll find something useful in there.

SmashingConf Antwerp 2024
SmashingConf Antwerp 2024
The venue for SmashingConf Antwerp, with just a handful of tickets left — all around design and UX. With hands-on workshops.

In the Smashing department, we are heading to beautiful Antwerp, Belgium, for our very last conference of the yearSmashingConf Antwerp (UX) 🍫, focused on design systems, AI interfaces, design patterns, UX research, dashboards and DataViz. We have just a handful of last tickets left! 🎉🥳

A few more Smashing events taking place soon:

With that, let’s dive into some of the shiny gems in front-end!
Have a productive week, everyone!

Vitaly


1. CSS Container Queries And Style Queries

Component-specific styling? What has long sounded like a dream to any developer, is slowly but surely becoming reality. Thanks to container queries, we can now query the width and style of the container in which components live.

Getting Started with Style Queries

As Una Kravets points out in her introduction to style queries, this currently only works with CSS custom property values, but there are already some real-world use cases where style queries shine: They come in particularly handy when you have a reusable component with multiple variations or when you don’t have control over all of your styles but need to apply changes in certain cases.

If you want to dive deeper into what’s possible with container style queries and the things we can — maybe — look forward to in the future, also be sure to take a look at Geoff Graham’s post. He dug deep to learn more about some of the more nuanced aspects of style queries and jotted down the things that stood out to him. Exciting times are ahead for CSS! (cm)


2. Auto Field-Sizing For Forms

Finding just the right size for an input field usually involves a lot of guesswork or JavaScript to count characters and increase the field’s height or width as a user enters text. CSS field-sizing is here to change that. With field-sizing, we can auto-grow inputs and text areas, but also auto-shrink short select menus, so the form always fits content size perfectly. All we need to make it happen is one line of CSS.

CSS Field-Sizing

Adam Argyle summarized everything you need to know about field-sizing, exploring in detail how field-sizing affects different <form> elements. To prevent your input fields from becoming too small or too large, it is also a good idea to insert some additional styles that keep them in shape. Adam shares a code snippet that you can copy-and-paste right away. (cm)


From our sponsor

Optimize Your Website Speed With Real User Data.

DebugBear
There’s tons of free tools to test your website speed. But to see how fast your website really is you need real user monitoring (RUM). DebugBear tracks your performance metrics and gives you in-depth reports to debug them, including request waterfalls and interaction elements. Find out about DebugBear RUM.


3. Making Hidden Content Searchable

Accordions are a popular UI pattern, but they come with a caveat: The content inside the collapsed sections is impossible to search using find-in-page search. By using the hidden=until-found attribute and the beforematch event, we can solve the problem and even make the content accessible to search engines.

Making collapsed content accessible with hidden=until-found

As Joey Arhar explains in his guide to making collapsed content searchable, you can replace the styles that hide the section with the hidden=until-found attribute. If your page also has another state that needs to be kept in sync with whether or not your section is revealed, he recommends adding a beforematch event listener. It will be fired on the hidden=until-found element right before the element is revealed by the browser. (cm)


4. Upcoming Workshops and Conferences

That’s right! We run online workshops on frontend and design, be it accessibility, performance, or design patterns. In fact, we have a couple of workshops coming up soon, and we thought that, you know, you might want to join in as well.

Smashing Online Events
With online workshops, we aim to give you the same experience and access to experts as in an in-person workshop from wherever you are.

As always, here’s a quick overview:


5. Simpler Snapping For Scalable Containers

Sometimes, you need a quick and easy way to make an element a scrollable container. CSS scroll snap makes it possible. The CSS feature enables you to create a well-controlled scrolling experience that lets users precisely swipe left and right and snap to a specific item in the container. No JavaScript required.

CSS Scroll Snap

Ahmad Shadeed wrote a practical guide that walks you step by step through the process of setting up a container with scroll snap. You can use it to create image galleries, avatar lists, or other components where you want a user to scroll and snap through the content, whether it’s horizontally or vertically. (cm)


From our sponsor

It’s Time To Change The Way We Build Digital Products.

Airtable
Keeping busy is easy. Driving business impact is what matters. Consistently align your people to the most strategic priorities, discover product opportunities from deep customer insights, and gain total visibility on execution with Airtable ProductCentral.


6. New Video Course: How To Measure UX And Design Impact

🎉 After many years, we’re happy to finally launch “How To Measure UX and Design Impact” (8h), a new practical guide for designers, researchers and UX leads to measure and visualize your UX impact on business. Use the code IMPACT to save 20% off today. Jump to details.

How To Measure UX & Design Impact

From establishing team-specific design KPIs to translating ambiguous objectives into practical design goals and making sense of OKRs, SUS, UMUX-Lite, TPI, KPI trees, feedback scoring, gap analysis, and Kano model, the course is filled with plenty of examples to help you measure UX. Jump to details.


7. Anchor Positioning For Tooltips And Popovers

Whether you use it for footnotes, tooltips, connector lines, visual cross-referencing, or dynamic labels in charts, the CSS Anchor Positioning API enables us to natively position elements relative to other elements, known as anchors. So, how can we make the most out of anchor positioning?

Introducing the CSS anchor positioning API

In her introduction to the CSS Anchor Positioning API, Una Kravets summarized in detail how anchor positioning works. She takes a closer look at the mechanism behind anchor positioning, how to tether to one and multiple anchors, and how to size and position an anchor-positioned element based on the size of its anchor. Browser support is still limited, so you might want to use the API with some precautions. Una’s guide includes what to watch out for. (cm)


8. Smooth Transitions With The View Transitions API

There are a number of use cases where a smooth visual transition can make the user experience more engaging. When a thumbnail image on a product listing page transitions into a full-size image on the product detail page, for example, or when you have a fixed navigation bar that stays in place as you navigate from one page to another. The View Transitions API helps us create seamless visual transitions between different views on a site.

Smooth transitions with the View Transition API

As Bramus Van Damme explains in his guide to the View Transitions API, view transitions can be triggered not only on a single document but also between two different documents. Both rely on the same principle: The browser takes snapshots of the old and new states, the DOM gets updated while rendering is suppressed, and the transitions are powered by CSS Animations. The only difference lies in how you trigger them. A small detail that can significantly improve the user experience. (cm)


From our friends

BTConf
Looking for an event that bridges the gap between tech and design? Beyond Tellerrand is exactly where you need to be — with Linda Liukas (who speaks about her playgrounds on which children learn programming without computers), Jessica Hische (who talks about her career as a designer and author), alongside Manuel Matuzovic, Sophie Koonin, Hidde de Vries, and many other speakers who will be in Berlin next month. Sounds interesting? Have a look and secure a ticket.


9. Recently Published Books 📚

Promoting best practices and providing you with practical tips to master your daily coding and design challenges has always been at the core of everything we do at Smashing.

In the past few years, we were very lucky to have worked together with some talented, caring people from the web community to publish their wealth of experience as printed books. Have you checked them out already?

Success At Scale
It’s here, and it’s shipping! Success At Scale, a new book by Addy Osmani. Get the book or browse the complete library.


10. Recent Smashing Articles


That’s All, Folks!

Thank you so much for reading and for your support in helping us keep the web dev and design community strong with our newsletter. See you next time!


This newsletter issue was written and edited by Cosima Mielke (cm), Vitaly Friedman (vf) and Iris Lješnjanin (il).


Sent to truly smashing readers via Mailchimp.
We sincerely appreciate your kind support. You
rock.

Follow us on Twitter Join us on Facebook

unsubscribe update preferences view in your browser

Older messages

#478: Inclusive Design

Sunday, October 20, 2024

Accessible numbers, ADHD, readability guidelines, neurodiversity design system and inclusive mindset workbook. Issue #478 • Oct 15, 2024 • View in the browser Smashing Newsletter Hej Smashing Friends,

#477: UX Kits, Tools & Methods

Tuesday, October 8, 2024

Playbook for universal design, UX deliverables glossary, UX toolts for better thinking and better design workshops. Issue #477 • Oct 8, 2024 • View in the browser Smashing Newsletter Hello Smashing

#476: How To Measure UX

Tuesday, October 1, 2024

New video course, measuring UX and usability for assistive technology users, free eBooks on UX impact, scorecards, and how to use the Accessible Usability Scale (AUS). Issue #476 • Oct 1, 2024 • View

#475: New Front-End Adventures

Tuesday, September 24, 2024

With color accessibility, font performance optimization, view transitions, and ethical web principles. Issue #475 • Sep 24, 2024 • View in the browser Smashing Newsletter Hej Smashing Friends, From

#474: Web Accessibility + Free Workshop

Tuesday, September 17, 2024

With guidelines on inclusive design, designing for ADHD, dyslexia, neurodiversity, dyscalculia and general do's and don'ts. Issue #474 • Sep 17, 2024 • View in the browser 💨 Smashing Newsletter

You Might Also Like

Behind the Design of Lauren Santo Domingo’s Ski House

Thursday, November 21, 2024

View in your browser | Update your preferences ADPro Peak Style When it comes to clients, says AD100 designer Andre Mellone, “my biggest nightmare is a person who says, 'Carte blanche, do whatever

2025 Interior Design Trends, Revealed

Wednesday, November 20, 2024

View in your browser | Update your preferences ADPro Image may contain: Furniture, Chair, Interior Design, Indoors, Home Decor, and Rug Inside Our Newest Trend Report “Design, like fashion, tries to

Want a free strategy session with us?

Wednesday, November 20, 2024

Plus, the emails editors open most often. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

One Simple Thing You Can Do to Retain Your Staff

Tuesday, November 19, 2024

View in your browser | Update your preferences ADPro By my account, it's not fall until I've watched You've Got Mail, Nora Ephron's '90s film adaptation of the 1930s Hungarian play

#483: UX Writing

Tuesday, November 19, 2024

With writing guides, content testing and practical guides for better content design. Issue #483 • Nov 19, 2024 • View in the browser Smashing Newsletter Hej Smashing Friends, Every digital product

Accessibility Weekly #423: Beautiful Focus Outlines

Monday, November 18, 2024

November 18, 2024 • Issue #423 View this issue online or browse the full issue archive. Featured: Beautiful focus outlines "Unfortunately, focus outlines are often overlooked in web design.

175 / Build your ideas without writing any code

Monday, November 18, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Nov 2024 • Part 1 View in browser Welcome to Issue 175 One month ago, I quit my longest-standing job and embarked on a pathless path to let my

Into the Fediverse

Sunday, November 17, 2024

Issue 221: We need decentralized social networks ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

The Books AD Editors Can’t Put Down Right Now

Friday, November 15, 2024

View in your browser | Update your preferences ADPro Good Reads Here at AD PRO, we're all about celebrating a good coffee table book. With crisp project imagery and behind-the-scenes stories tucked

What astrology has to do with PR?

Wednesday, November 13, 2024

and, no we won't tell you to read your chart! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏