Skip to content

parsing failure with border shorthand and css4 hsl() color #89

@phiw13

Description

@phiw13

clean-css drops the color parameter in a border short-hand when the color is specified using css4 comma-less translucent hsl() – and possibly other color formats such as rgb() / hwb / but I have not tested those.

input: border-top: 1em solid hsl(0 5% 5% / .5);

actual output: border-top:1em solid;

expected output: border-top:1em solid hsl(0 5% 5% / .5);

The border shorthand can be anything of border or border-top, etc. Surprisingly, the logical equivalent (e.g. border-block-start) seems to parse correctly.

cleancss -d -O2 --format 'breaks:afterComment=on' -o style.min.css style.css

clean-css-cli version: 5.6.2
macOS 13.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions