Embracing Playful Imperfection With The CSS `random()` Function
2026年10月20日
AI 摘要 AI 生成,可能有误
This article explores the newly shipped CSS random() function, which generates pseudo-random values directly in stylesheets without JavaScript, covering its syntax, unit matching, step rounding, and caching keys for keeping values in sync across properties. Despite the author's design-system instincts favoring consistency, a series of CodePen demos—tilted letters, procedurally animated bouncing text, and splayed cards—show how subtle, controlled randomness can add organic, human charm to otherwise sterile interfaces, along with accessibility caveats like protecting screen readers from letter-by-letter spans. The function is supported in Safari and rolling out in Chrome 156 with positive signals from Firefox, so the author recommends progressive enhancement via @supports, and also previews the upcoming random-item() function for picking randomly from a list of design tokens.
In design, we love spending hours obsessing over consistency, grids, and alignment. But when I heard that the native CSS random() function landed in Safari and is rolling out in Chrome 156, I started wondering: where does randomness actually make sense on the web? Is it something we want in our design system? To find out, I did what I always do in doubt: I built a bunch of playful CodePen demos exploring organic typography, bouncing letters, splayed cards, and a punk fanzine.
As someone who loves building design systems and tinkering with CSS architecture, a big part of my day job revolves around control. We set up spacing scales, lock down typography, set up color tokens, and make sure everything aligns on a grid. Consistency is usually our bread and butter as design engineers and a proud badge of skill when creating design systems. If a card suddenly jumps 20 pixels to the left on a refresh, it’s not creative expression; it’s a bug that the project manager will log.
So when I first heard that the native random() function from the CSS Values and Units Level 5 spec was shipped in Safari, and is currently rolling out in Chrome 156 (with positive signals from Mozilla on Firefox as well), my first reaction was: that’s pretty cool!
继续阅读全文
为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。
AI 摘要The article explains how to build an effective cross-browser testing checklist from real production bugs rather than generic categories, illustrating with concrete examples how features like date parsing, 100vh/100vw viewport units, Chrome's device mode, user-agent detection, third-party cookies, and performance metrics behave inconsistently across Chrome, Edge, Firefox, and Safari on desktop and real mobile devices. It argues that useful checklist entries specify a browser/device, a condition, and an observable result, and that teams should add new entries each time a cross-browser bug escapes to production. Finally, it shows how to automate each check through CI jobs, visual regression testing, lint rules, and testing on real devices.
AI 摘要As part of a monthly tradition running for more than 15 years, this post presents a collection of December 2026 desktop wallpapers created by artists and designers from around the world, available in a wide range of screen resolutions and in versions with or without a calendar. The wallpapers cover festive and wintry themes such as gingerbread houses, snowy walks, and Christmas traditions, with each artist given full creative freedom over their design. The post invites readers to contribute their own creations for future editions.
AI 摘要SmashingConf is hosting AI 2027, a live online half-day conference on December 1, 2026, focused on how AI can improve workflows for UX designers, front-end engineers, and design system teams, without the hype. The event features practical sessions from experts including Vitaly Friedman, Anna Arteeva, Christine Vallaure, TJ Pitre, Brad Frost, and Luke Murphy, covering topics like designing AI experiences, prototyping AI functionality, Figma MCPs, AI-ready design systems, and documentation for coding agents, followed by moderated breakout rooms. Tickets cost $55 for individuals and $44 per person for teams of four or more.
AI 摘要The article, drawing on Level Access's 2026 State of Digital Accessibility Report, argues that AI has dramatically accelerated planning, design, and development in the software lifecycle while accessibility testing has lagged behind, creating a two-speed workflow. Survey data shows that AI adoption alone isn't the differentiator—organizations with mature accessibility practices (training, culture, communication) benefit most, using AI as an amplifier rather than a solution. The author recommends embedding human judgment at three checkpoints—finding issues early (via design handoffs, CI/CD gates, and assigned ownership), fixing issues while context is fresh, and documenting evidence—integrated into existing workflows so accessibility keeps pace with AI-driven development speed.
AI 摘要The article proposes a four-question audit that helps product teams decide whether an AI feature earns its place by weighing what it returns users (removed effort, caught errors, consistency) against the attention and identity costs it imposes, framed as a 'break-even line.' The four questions ask whether the feature reduces total task effort for a specific user segment, whether it beats the user's current method, whether users can realistically catch errors, and whether users will retain the judgment to detect AI mistakes after a year of use. Each question yields a concrete design condition, such as scoping features to the users they serve, adding provenance displays for low-visibility high-consequence errors, and building verification mechanisms like blind review into workflows.