Skip to content

Unminifying a CSS rule that has a width or max-width as the last style (without a semi-colon) fails #6

@fuad-tareq

Description

@fuad-tareq

This was part of the result of un-minifying a stylesheet:

.pnd-img {
    width: auto;
    height: auto;
    position: relative;
    max-width: 100%}

Whereas the expected result is:

.pnd-img {
    width: auto;
    height: auto;
    position: relative;
    max-width: 100%;
}

Your (awesome!) tool manages to handle adding the missing semi-colons in seemingly all other scenarios except when the last style/property is a width, min-width, or a height. This is also an issue when the only style in the defined rule is a width, min-width, or a height.

Note 1: I've only tried this on: https://mrcoles.com/blog/css-unminify/

Note 2: Oddly enough, this wasn't always the case (but it did fail this about 80% of the time).

Note 3: I'm starting to wonder if maybe the % sign at the end is the problem. Because there were also odd cases of it failing when the last style was a left: 0%, margin-bottom: 5%, flex-basis: 50%, etc. The only exception to this has been one rule that ended with a content: "/".

Note 4: It also failed to add a new line after the closing bracket of a media query.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions