IT技术博客大学习 共学习 共进步
全部 移动开发 后端 数据库 AI 算法 安全 DevOps 前端 设计 开发者

What’s !important #14: Gap Decorations, random(), field sizing, and More

CSS-Tricks 2026-06-30 22:41:00 累计浏览 2 次
本机暂存

I know you’re busy, so for What’s !important #14, I’ll be sprinting through what’s been a stacked couple of weeks despite few browser updates. From CSS Quake to CSS Gap Decorations, this isn’t one to miss!

Hyperblam: Make music with HTML

Heydon Pickering created Hyperblam, a HTML-driven implementation of the Web Audio API that uses Web Components to create music without JavaScript.

A website screenshot for Hyperblam featuring a black background with a stylized white logo above navigation links, large hand-drawn text reading WRITE MUSIC NOT JAVASCRIPT, followed by a brief introductory sentence explaining that Hyperblam lets users make music with HTML.

Okay, not very CSS-y, but still pretty cool!

CSS Quake

Powered by PolyCSS, Layoutit created CSS Quake, a port of the groundbreaking 1996 game, Quake.

A screenshot of the first playable moment of Quake.

Very CSS-y, and a perfect companion to CSS DOOM, which also shipped recently.

A head-first dive into CSS Gap Decorations

Temani Afif showed us how to style gap decorations. As you might’ve guessed, ‘gaps’ are the spaces that gaps take up when using flexbox, grid layout, or multi-column layout. To be honest, gap decorations have been a long time coming, but as Temani demonstrated, there’s actually a lot that we can do with them.

CodePen Embed Fallback

CSS random() experiments

Polypane demonstrated their CSS random() experiments. If you’ve been wondering about this elusive CSS function, which still isn’t supported by any browser but Safari, Polypane has created a bokeh effect, some falling petals, an untidy stack of polaroids, a poem, an animated aurora, and more. It’s a pretty deep dive that seemingly shows us everything that we can do with random().

Source: Polypane.

How to make <select>s fluid

Manuel Matuzović showed us how to set the width of <select>s to the width of their selected <option> with field-sizing (field-sizing: content, to be more specific), which became Baseline when Firefox 152 shipped it a fortnight ago.

Another thing to note is that if we use the size attribute (e.g., <select size="3">), which turns the <select> into a scrollable list box showing three <option>s by default, field-sizing: content overrides that to show all <option>s.

The new standard for CSS theming

Una Kravets explained how modern CSS theming works. We’ve seen a whole lot of this lately, but Una talks about @property, light-dark(), contrast-color(), and @container style(), all of which are also Baseline as of recently, so this is a great opportunity to see how all of these features work together.

CodePen Embed Fallback

Speaking of which, I wrote up a thing about contrast-color() after exploring it for the first time.

Why websites don’t need to work the same way for everybody

Bramus explained why websites don’t need to work the same way for everybody. For example, different platforms have different primary input modalities, and even then, users might have a secondary one hooked up that they prefer, which is why we need to abandon the idea of making websites identical across platforms.

He also talks about three incredibly interesting web platform features — interest invokers, overscroll actions, and the Document Picture-in-Picture API — that must function differently depending on the platform.

Marina Aísa at Web Engines Hackfest

While everybody was still talking about CSS Day (including me), Web Engines Hackfest was kicking off in A Coruña, Galicia. What I love about these events (besides the talks, of course) is attendees talking about the talks, the people that they met, what else they did while they was in town, and so on.

Here’s Marina Aísa documenting the two-day event, starting off with a hike in a Galician forest, then two days of talks about web engines and web standards (interspersed with some wall climbing), then finally some discussion about what browsers can do to help improve web accessibility:

This week I'm in A Coruña, Galicia, attending the @webengineshackfest.org ‍ where we are discussing the future of web engines and standards. Given the potential impact on future web development, I thought it would be helpful to share some of my personal notes from the event. ✍️

— Marina Aísa (@marinaaisa.com) 14:31 · Jun 16, 2026

Personal goal for next year: to attend one of these events!

New web platform features

Yes, it’s been a dull couple of weeks for stable browsers, but there are some really exciting things coming up. Keep your eyes on our Quick Hits, because that’s where I share these web platform updates first (plus those from developmental browsers). In fact, Chrome 150 will be shipping later today.

See ya’ll in two weeks!


What’s !important #14: Gap Decorations, random(), <select> field sizing, and More originally handwritten and published with love on CSS-Tricks. You should really get the newsletter as well.

同分类推荐文章

  1. The Shifting Line Between CSS States and JavaScript Events (2026-06-29 21:03:32)
  2. 浏览器原生支持JSON模块导入与开发啦! (2026-06-29 19:49:17)
  3. translateZ() (2026-06-25 21:18:56)

查看更多 前端 文章 →

建议继续学习

  1. 50个活力和动感的网页设计-颜色的灵感 (累计阅读 34,451)
  2. 视觉设计前瞻实用性研究(PNVD) 第二期 (累计阅读 12,988)
  3. 各公司对前端开发的职位描述 (累计阅读 10,410)
  4. iframe大小自适应 (累计阅读 10,064)
  5. 浏览器的渲染原理简介 (累计阅读 8,390)
  6. 解决IE6从Nginx服务器下载图片不Cache的Bug (累计阅读 8,362)
  7. 程序员眼里IE浏览器是什么样的 (累计阅读 8,015)
  8. 2010网页设计趋势 (累计阅读 7,822)
  9. Web前端工程师编程能力飞升之路 (累计阅读 7,703)
  10. 颜色的代码表达式 (累计阅读 7,672)