Skip to content

Commit

Permalink
Moved file contents into faq
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Silver committed Jun 14, 2016
1 parent a4d934a commit 8ded494
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 59 deletions.
50 changes: 50 additions & 0 deletions _chapters/11-faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,56 @@ However, in my experience, this is *rarely* the case, and so I wouldn't advise t
color: ...;
}

## Where do I put Media Queries?

Generally speaking, the screen should adapt to the content, not the other way around. This means that a module's breakpoints are determined by the module itself, and *not* by a predetermined set of break point such as "small", "medium" and "large". Doing it this way would constrain the design and quite possibly degrade the User Experience unnecessarily.

Therefore, all styles—even those that are wrapped in Media Queries—should be located next to regular styles:

.basket {}

@media(min-width: 500px) {
.basket {}
}

@media(min-width: 1000px) {
.basket {}
}

.basket-heading {}

## Where do I put modifiers and states?

Just like media queries, states and modifiers should be located in close proximity to the element they pertain to:

.basket {}

.basket-isHidden {}

.basket-heading {}

.basket-heading-someModifier {}

## Should I add comments?

If you take an approach whereby multiple modules reside within a single CSS file, it's a good idea to segregate those with a chunky comment:

/********************************************
* Basket
********************************************/

.basket {}

.basket-heading {}

/********************************************
* Thinger
********************************************/

.thinger {}

.thinger-details {}

## Can't find an answer here?

Raise an issue on [Github](https://github.com/adamsilver/maintainablecss.com/issues/new) and I will get back to you as soon as I can. Thanks!
59 changes: 0 additions & 59 deletions _chapters/12-file.md

This file was deleted.

0 comments on commit 8ded494

Please sign in to comment.