원문 읽기

How CSS Randomness Can Make Websites Feel More Playful

2026년 10월 20일출처 Smashing Magazine

CSS random() lets developers add controlled visual variation while keeping structure, browser support, and accessibility in mind.

Design systems usually make every element consistent. They use fixed spacing, type, colors, and grids. Front-end developer Brecht De Ruyte asked where small differences could help instead. The new CSS random() function is available in Safari and is reaching Chrome 156. It creates random values inside CSS without JavaScript or long Sass loops.

Developers set a minimum and maximum value with the same unit. They can also add a step size. The browser then chooses a value inside those limits. A custom property can share one value across several rules. For example, the same random size can control width and height. This keeps a square shape while allowing each square to have a different size.

De Ruyte tested the feature in several CodePen demos. He gave letters small random angles and made them move together on hover. He also changed jump height, speed, and shape for bouncing text. Negative animation delays made each letter start at a different point. Other demos tilted cards, varied scroll speed, and used blur and opacity for a camera-like depth effect.

Randomness should support the design, not damage it. A dashboard needs clear and stable information. A children’s site, photo collection, or creative portfolio may allow more play. The developer can combine math for the main structure with random values for small changes. The @supports rule can give browsers a safe fallback while support is still growing.

Accessibility is also important. Separate letter spans may make screen readers read each character. Developers should hide decorative spans and provide the whole word for assistive technology. They should also respect reduced-motion settings. The article’s main point is simple: design systems can stay strong while allowing a little controlled imperfection. Native CSS now makes that easier and avoids JavaScript overhead.

핵심 표현

  • add a little variation

    약간의 변화를 더하다

    Random values can add a little variation.

  • stay within limits

    정해진 범위 안에 머물다

    The movement should stay within limits.

  • keep in mind

    ~을 염두에 두다

    Designers must keep accessibility in mind.

AI를 사용해 생성되었으며, AI는 실수를 할 수 있습니다.