Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better ordering of style rules and properties #160

Merged

Conversation

Hikariii
Copy link
Contributor

@Hikariii Hikariii commented Sep 20, 2016

This PR solves the same issues as #159 and #155, and more.
It assigns all issues reported in #140.

This pr too takes priority into account by sorting the rules via the already available method, but sorting happens later (when you need it) when rules are inserted, not when they are parsed and collected.

When processing properties it does not just overwrite the properties but it unsets and adds them.
This ensures that the order is correct and the css like the one below is processed correctly too:

td  {
    padding: 0;
}

td  {
    padding-bottom: 20px;
}

td  {
    padding: 0;
}

The specificity tests are updated to reflect the changes made with ordering the rules and properties.
It also tests all the different uses cases mentioned in #140.

@Hikariii Hikariii changed the title rules ordered and properties unset and set to preserve prio Better ordering of style rules and properties Sep 20, 2016
@tijsverkoyen tijsverkoyen merged commit 1dc1c7e into tijsverkoyen:master Sep 20, 2016
@stof
Copy link
Collaborator

stof commented Sep 20, 2016

@tijsverkoyen please also tag a new release with all the recently merged patches

@tijsverkoyen
Copy link
Owner

Done, just released 2.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants