Skip to content

[cssom] getComputedStyle and/or computedStyleMap to return authored value #10002

@NickGard

Description

@NickGard

Hello, I'm an engineer at Webflow, a tool that helps users build websites without having to know all of the CSS/HTML/JS that goes into it. I'm working on part of the tool that checks for accessibility issues and a problem I've run into recently is that I can't get the authored styles for font-size using either getComputedStyle or computedStyleMap. I'd like to know that the user hasn't set the font-size for an element in px units, or that they're at least partially set with rem units, like calc(2vw + 0.5rem). When I use the CSSOM APIs to check the style, I only get the resolved size in px units.

Is there any way to change this to report the user-authored value? Or can we create another API to do that, like getAuthoredStyle?

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