Visitar URL original
random() · Issue #514 · web-platform-dx/developer-signals · GitHub
Skip to content

random() #514

Open
Open

Description

@github-actions

This GitHub issue is for collecting web developer signals for random().

The random() CSS function chooses a random numeric value within a specified range. This allows for dynamic, randomized styling using CSS.

Browser support

chromeavailable edgeunavailable firefoxunavailable safariavailable
  • Chrome 156 (Oct 20, 2026)
  • Chrome Android 156 (Oct 20, 2026)
  • Edge: not supported
  • Firefox: not supported
  • Firefox for Android: not supported
  • Safari 26.2 (Dec 12, 2025)
  • Safari on iOS 26.2 (Dec 12, 2025)

Give us feedback

If you're pressed for time, but you want this feature to be available in all browsers, please give this issue a thumbs up 👍 reaction.

However, a much better guide for us is to know how you'd use this feature, and what you're having to do in the meantime. This helps us judge the priority versus other features.

Copy the template below in a comment, and add the details that matter to you.

## What I want to do with this feature

<!-- Add your specific use-cases, even if they seem obvious to you. -->

## What I'm having to do in the meantime

<!--
Are you having to use another feature instead, a polyfill, or is it blocking you completely?
Why are the alternatives worse than using this feature?
-->

All comments are expected to adhere to the Code of Conduct.

Learn more

You can learn more about this feature here:

Activity

  1. casparfairhall commented on Oct 20, 2026

    @casparfairhall

    What I want to do with this feature

    CSS random() is valuable for generating novel animations and layouts with a very low overhead. The broad trend in CSS for features such as this is obviating the need for JavaScript, especially when it comes to animations, is a very positive one.

    What I'm having to do in the meantime

    I'm having to use a polyfill for now, since cross-browser support is lacking. The sooner random() can be considered a baseline feature, the better.

  2. kizu commented on Oct 20, 2026

    @kizu

    What I want to do with this feature

    For improving the visual design of web pages by making slight adjustments like choosing a random one to show, or transforming some elements to look more natural and less uniform.

    What I'm having to do in the meantime

    Aside from JS, with regular CSS, we have to rely on some awkward math to achieve pseudo-random — either simpler techniques based on cicada principle, or something like what I describe in my article here: https://kizu.dev/tree-counting-and-random/

  3. lucascantor commented on Oct 29, 2026

    @lucascantor

    What I want to do with this feature

    A zero-JS "slot machine" animation effect on my homepage at lucascantor.com: a reel of facts about me spins and lands on a random one, and a dice button spins again. Radio inputs, :has() and @keyframes already do everything except the actual randomness.

    What I'm having to do in the meantime

    I pre-render 16 copies of the homepage and use a CDN edge script to serve one at random. That makes the homepage uncacheable, and each copy needs noindex plus a canonical link. Clicks within a visit follow a fixed cycle, so it's still not truly random. random() would replace all of this overhead with one CSS declaration per state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions