Skip to content

[css-images-4] Include gradients in the cross-fade() notation #5860

@m6o

Description

@m6o

Currently, the cross-fade() notation allows including colors (https://drafts.csswg.org/css-images-4/#cross-fade-function).

Also allow including gradients.

cross-fade() = cross-fade( <cf-image># )
<cf-image> = <percentage>? && [ <image> | <gradient> | <color> ]

If a <gradient> is provided, it represents a gradient image with “automatic” dimensions (it doesn’t participate in the sizing of the result image at all; see details in the sizing details below).

This allows images to be cross-faded to gradients, but also allows mixing gradients of different functions.

The cross-fade() notation may then be used for interpolating gradients which do not conform to the restrictions currently specified for interpolating gradients (https://drafts.csswg.org/css-images-4/#interpolating-gradients). Ideally these transitions are translated to a cross-fade internally.

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