【问题标题】:What is the difference between @include breakpoint and @include at-breakpoint?@include 断点和@include 断点有什么区别?
【发布时间】:2013-11-16 04:22:02
【问题描述】:
我有一个问题,因为我正在处理我的团队正在使用@include 断点和@include at-breakpoint 的项目。我们正在使用 sass、compass 和 susy。两者有什么区别?
【问题讨论】:
标签:
sass
susy-compass
compass-sass
【解决方案1】:
at-breakpoint 是 Susy 的一部分,用于更改不同断点处的总列数。受初始语法的启发,Mason Wendell 创建了一个更强大、更通用的Breakpoint Plugin 来管理您的所有媒体查询。现在,很多人(包括我)在同一个项目中同时使用两者。它们可以很好地协同工作,但差异可能会令人困惑。
- 如果您想根据最小/最大宽度媒体查询更改 susy
$total-columns 设置,请使用 at-breakpoint。
- 将
breakpoint 用于更复杂的媒体查询,或者您不想更改列数的任何地方。
如果您只想使用其中一个,并且更加一致,您可以使用简写重新创建at-breakpoint 的功能:
@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 只是一个捷径。