Skip to content

[css-images] Computed gradient colors #4042

Closed

Description

@ewilligers

Suppose an author sets various <image> properties to gradients with color keywords, e.g. linear-gradient(45deg, blue, orange) . Should getComputedStyle() results show gradients with color keywords or rgb functions?

Firefox gives rgb functions. Blink, Edge 18 and Safari give color keywords.
https://jsfiddle.net/ericwilligers/qzp4wy03/

Should we change the "Computed value" text for shape-outside

..., the <image> with its URI made absolute, otherwise as specified.

=>

..., the <image> with its URI made absolute and colors computed, otherwise as specified.

background-image and border-image-source would need a similar change if they referenced the CSS Images 3 definition of <image>, but they currently don't.

No change would be needed for list-style-image

computed value of the <image>, or none

Activity

  1. AmeliaBR commented on Jun 19, 2019

    @AmeliaBR
    Contributor

    I would expect the color format to be serialized in the same form as <color> types in other properties.

    Rather than define this every time a property includes an <image> type, it would be nice if we could define the computed/serialized form for a gradient function itself. And then use the "computed value of the <image>" wording for properties.

  2. tabatkins commented on Jun 20, 2019

    @tabatkins
    Member

    Yeah, we just need a definition for "computed <image>" that can be reused, it's silly to copy boilerplate like this that gets out of sync.

  3. ewilligers commented on Jun 21, 2019

    @ewilligers
    ContributorAuthor

    This also affects lengths (radial-gradient, conic-gradient). Firefox and Edge make lengths absolute, Blink and Safari do not (e.g. getComputedStyle() gives results with ex).

  4. AmeliaBR commented on Jul 9, 2019

    @AmeliaBR
    Contributor

    Agenda+ to get a resolution, unless @ewilligers would rather we wait until the next APAC-friendly meeting?

  5. ewilligers commented on Jul 9, 2019

    @ewilligers
    ContributorAuthor

    No need to wait. I expect there is simply a browser bug in Blink, Edge 18 and Safari. There appears to be consensus about adding computed image.

  6. 9 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions