Skip to content

CSS properties ordered alphabetically on build #2395

Closed
@lionel-bijaoui

Description

@lionel-bijaoui

Version

3.0.1

Reproduction link

https://github.com/lionel-bijaoui/demo-order-css

Node and OS info

Node 8.11.4 / npm 5.6.0 / Windows 10

Steps to reproduce

Create a vue-cli project with scss support.
Create a basic component with a style block and add a class.
In this class, put the properties in non alphabetical order.
If you run npm run serve and inspect the style, they should be in the same order as what you wrote them.
If you run npm run build and inspect the style, they will be in alphabetical order

What is expected?

.someclass {
    border-radius: 0;
    border-bottom-right-radius: $radius;
    border-top-right-radius: $radius;
}

What is actually happening?

.someclass {
    border-bottom-right-radius: $radius;
    border-radius: 0;
    border-top-right-radius: $radius;
}

The CSS properties get reordered alphabetically and it can create unexpected side effects
The change in behavior was observed between v3.0-beta.10 and 3.0.1 but it might be older.
I guess it has something to do with minification, but I was unable to find any option or mention in the changelog.

EDIT: Added link to repo of demo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions