Skip to content

[css-paint-api] Allow inputArguments define optional arguments #763

@zheeeng

Description

@zheeeng

The custom paint requires a color argument.

class MyPaint {
    static get inputArguments() { return ['<color>']; }

    paint(ctx, size, styleMap) {
        // Paint code goes here.
    }
}

registerPaint('my-paint', MyPaint)

At present, the correct usage is background: paint(my-paint, red).

Wish there is a way to make this color argument be optional: background: paint(my-paint)

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