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

Increase base for specifity #56

Closed
wants to merge 2 commits into from
Closed

Conversation

barryvdh
Copy link
Contributor

Following http://www.w3.org/TR/selectors/#specificity, the specifity is concatenating a,b and c. It notes that the base should be large enough. So it should be something like 2,9,3= 293, but 2,11,3 (=313) should be lower then 3,0,0 (300). This make 2,11,3 = 21103 and 3,0,0 = 30000. So it is still not always perfect, but better ;)

Following http://www.w3.org/TR/selectors/#specificity, the specifity is concatenating a,b and c. It notes that the base should be large enough. So it should be something like 2,9,3= 293, but 2,11,3 (=313) should be lower then 3,0,0 (300). This make 2,11,3 = 21103 and 3,0,0 = 30000. So it is still not always perfect, but better ;)
@barryvdh
Copy link
Contributor Author

And this line: https://github.com/tijsverkoyen/CssToInlineStyles/blob/1.3.0/CssToInlineStyles.php#L553
means that the specificity increases with every rule? Is that in the spec? Should the factors be higher, so that the order is less important then the rule itself? Or should that be ignored and use the order the rules are added to the array?

Isn't as important as the specificity.
@barryvdh barryvdh closed this Jul 16, 2014
@barryvdh barryvdh mentioned this pull request Jul 16, 2014
@barryvdh barryvdh deleted the patch-2 branch September 18, 2014 07:51
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.

1 participant