@include断点和@include at-breakpoint有什么区别?

时间:2013-11-14 20:33:50

标签: sass susy-compass compass-sass

我有一个问题,因为我正在开展一个项目,我的团队正在使用@include breakpoint和@include at-breakpoint。我们正在使用sass,指南针和susy。这两者有什么区别?

1 个答案:

答案 0 :(得分:1)

at-breakpoint是Susy的一部分,用于更改不同断点处的总列数。受初始语法的启发,Mason Wendell为管理所有媒体查询创建了更强大,更通用的Breakpoint Plugin。现在,很多人(包括我)都在同一个项目中使用。他们一起工作很好,但差异可能会令人困惑。

  • 如果您想根据最小/最大宽度媒体查询更改您的可疑at-breakpoint设置,请使用$total-columns
  • 使用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只是一个捷径。