Skip to content

Improve CSS sorting #742

@sampullman

Description

@sampullman

We currently sort CSS so that -webkit properties are at the end. This is necessary for certain styles to work correctly, such as gradient backgrounds. It's a lot of extra computation for a relatively niche feature, so it would be better to find a solution that doesn't rely sorting on every render.

One option is to implement real ordering in CSS properties, and ensure the necessary -webkit properties are added at the end in the editor. In this case, it would still be possible for the user to manually break gradients.

Another option is to move the sorting to rawStyleToResolvedStyleWithSource, although this is only used in the live/preview sites and not the builder.

It may also be possible to only re-render styles when we know they've changed, but this requires more thought and planning.

Notes

See this PR comment: https://github.com/samatechtw/pubstudio-builder/pull/351/files#r1495767920

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions