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

Planning mode

Friday, December 20, 2024

Lessons from our first-ever annual planning sprint ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

We Co-Sign This AD100-Approved Trend

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Emboldening the Bath Marble, marble, everywhere, and every drop is chic. According to AD100 designer Jake Arnold, “material drenching”—that is,

177 / Keep calm by listening to these ambient sounds

Thursday, December 19, 2024

Product Disrupt Logo Product Disrupt Half-Monthly Dec 2024 • Part 1 View in browser Welcome to Issue 177 Lately, I've been driving a lot of inspiration from the things I see in real life. The range

The Year in Color: Hella Jongerius, Mocha Mousse, and More

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Color Our World Since the summer, AD PRO has kept its finger on the pulse of color predictions. Overall, the vibe right now is down to earth,

🐺Get Media Features in 2025

Thursday, December 19, 2024

A BIG Wolf Craft announcement!! ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Small teams

Thursday, December 19, 2024

Issue 224: Why the mentality of lean and small always wins ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Accessibility Weekly #427: The Myth of Accessible Components

Thursday, December 19, 2024

December 16, 2024 • Issue #427 View this issue online or browse the full issue archive. Featured: The myth of 'accessible components and done' "Think you've solved all your

Here's what you missed...

Thursday, December 19, 2024

Get press for your business in 2025...here's how. ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏

Kelly Wearstler on the Rigorous Routine That Keeps Her Churning

Thursday, December 19, 2024

View in your browser | Update your preferences ADPro Kelly Wearstler has expanded her content empire. Earlier this month, the AD100 Hall of Fame designer announced the launch of Wearstlerworld, a

#487: Useful Templates And Canvases For Designers

Thursday, December 19, 2024

With new ways of working, facilitation techniques, guides to design interviews, culture design and user task canvas templates. Issue #487 • Dec 17, 2024 • View in the browser Smashing Newsletter