문제

I have a question because I am working on a project where my team is using @include breakpoint and @include at-breakpoint. We are using sass, compass, and susy. What is the difference between the two?

도움이 되었습니까?

해결책

at-breakpoint is part of Susy, and is used for changing your total column-count at different breakpoints. Inspired by that initial syntax, Mason Wendell created a more powerful and generic Breakpoint Plugin for managing all your media-queries. Now, many people (including me) use both in the same project. They work great together, but the differences can be confusing.

  • Use at-breakpoint when you want to change your susy $total-columns setting based on a min/max width media-query.
  • Use breakpoint for more complex media-queries, or anywhere you don't want to change the number of columns.

If you want to use only one of them, and be more consistent, you can recreate the functionality of at-breakpoint using the longhand:

@include breakpoint($media-query) { // set your media-query
  @include layout($columns) { // set your columns
    // nested code will use the new column count at the given media-query
  }
}

at-breakpoint is simply a shortcut for that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top