Skip to content

Inline styles do not parse ! important correctly due to extra whitespace #4125

Closed
@nolanlawson

Description

@nolanlawson
<div lwc:spread={fake} style="color: red ! important"></div>

The above should render with color: red having a priority of important. However, it loses the important priority because, when the static content optimization is not active, we do not parse the important priority correctly (due to the whitespace: ! important).

Repro Karma test: 8136599

This test will succeed when the static content optimization is enabled, but it will fail when using DISABLE_STATIC_CONTENT_OPTIMIZATION=1. The reason it succeeds with the optimization is because we leave the style attribute alone and don't try to format it.

See also: #3548.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Up for grabsIssues that are relatively small, self-contained, and ready for implementationbug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions