Skip to content

[css-values-5] Caching CSS random() values in if() #13662

@tursunova

Description

@tursunova

There is an existing issue about random() and other tree scope functions used outside element context, so it is unclear how random() should behave in @container style queries now. However we can also use random() in style() condition inside if():

color: if(style(random(--rand property index, 1, 1000) = random(--rand property index, 1, 1000)): green; else: red;);

In the example above it's unclear whether both random() values should use same or different index for caching, in other words, what is the same property value in the statement below:

A nullable integer index: the index of the random function among other random functions in the same property value, if index or auto is specified; otherwise null.

if(style(random(1) = random(2)): random(3); else: random(4));

So are random(1), random(2), random(3) and random(4) all different property values?

cc: @tabatkins

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