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

Composing margin and padding rules #242

Open
ryanve opened this issue Jun 13, 2017 · 1 comment
Open

Composing margin and padding rules #242

ryanve opened this issue Jun 13, 2017 · 1 comment

Comments

@ryanve
Copy link

ryanve commented Jun 13, 2017

The ordering of the class rules for margin and padding causes what to me seem unintuitive composing precedence issues. Is this by design? Examples: https://codepen.io/ryanve/pen/JJKQzx

Current (v8)

  • higher numbers override lower numbers regardless of which side
  • x and y classes override shorthand and individual sides
<p class="p3 pr1">p3 wins</p>
<p class="p1 pr3">pr3 wins</p>
<p class="p4 pr2">p4 wins</p>
<p class="px4 pr1">px4 wins (but pr1 winning seems more intuitive)</p>
<p class="mx-auto ml2">mx wins (but ml2 winning seems more intuitive)</p>

Expected

  • individual sides override shorthand sides
    • then after that higher numbers win
  • x and y classes overrides the main shorthand but not individual sides
@juytter
Copy link

juytter commented Dec 15, 2017

Can be fix by writing padding-all (.p0, .p1 ... ) first in css.

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

No branches or pull requests

2 participants