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

Utility classes don't always overwrite other classes #17

Closed
dariusrosendahl opened this issue Oct 28, 2016 · 1 comment
Closed

Utility classes don't always overwrite other classes #17

dariusrosendahl opened this issue Oct 28, 2016 · 1 comment
Labels
Milestone

Comments

@dariusrosendahl
Copy link
Member

Example:

// project stylesheet 
.block {
    margin-bottom: 12px;
}

Now, when we have an element on the webpage:

<!-- example block -->
<div class="block mb-0">
    My .blocks always have a margin bottom, 
    This one time I want margin-bottom: 0; without creating an extra stylesheet.
</div>

What happens is that utility classes (margin, padding, etc) never overwrite the normal styling from stylesheets because they are imported after the core.

A few proposed solutions:

  • Don't ever use padding / margin in blocks but only with utility classes
  • Importants on utility classes
  • Move utility and utility_spacers to the bottom of the main.scss

The last option has our preference, the only downside would be that a utility class always overwrite another class. If you want to change this you have to remove the utility class or deeper specify the class.

@dariusrosendahl
Copy link
Member Author

Fixed in 2.0.1

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

No branches or pull requests

1 participant