Skip to content

ComputeCurrentStyle should resolve CSS variables #62

Closed
@The-Nutty

Description

@The-Nutty

New Feature Proposal

Description

When using IElement.ComputeCurrentStyle i would expect CSS variables to be resolved for example when parsing the document:

<!DOCTYPE html>
<html>
<head>
    <style>
        :root {
            --color: #FFFFFF;
        }

        p {
            color: var(--color);
        }
    </style>
</head>
<body>
    <p>This is a test</p>
</body>
</html>

I would expect doc.GetDescendantsAndSelf().OfType<IHtmlParagraphElement>().First().ComputeCurrentStyle()["color"] == "#FFFFFF" for example. But instead its rgb(var(--color)). However i would understand if ComputeCurrentStyle should not resolve CSS variables if thats the case i think it would be useful to have an extention method or utility that can do this.

Is this something you are interested in adding or if you pointed me in the place you this method should belong i could have a crack at submitting a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions