@include容器是什么意思? [英] What does @include container mean?

查看:210
本文介绍了@include容器是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始使用Compass和Susy。我的目标是让我的布局适应手机,平板电脑和桌面屏幕尺寸。
在Susy示例中( susy.oddbird.net )或 SO问题),有一个具有适合于屏幕尺寸的列数的模式。具体来说,有这样的嵌套规则:

I am getting started with Compass and Susy. My goal is to make my layout adapt to phone, tablet, and desktop screen sizes. In the Susy examples (susy.oddbird.net or SO question), there is a pattern of having the number of columns adapt to the screen size. Specifically, there are nested rules like these:

.container {
  @include container;

  @include desktop {
    @include container;
  }
}

我的问题:容器是什么{@include container} do?

My questions now: What does the container { @include container } do? And, why is it nested again in the desktop include?

推荐答案

容器 mixin建立页面的宽度。你只需要重复它在不同的断点,如果宽度应该改变(因为他们将与自适应布局)。如果使用流体网格,则无需重复。

The container mixin establishes the width of your page. You only need to repeat it at different breakpoints if that width should change (as they would with adaptive layouts). If you are using a fluid grid, there is no need for the repetition.

这篇关于@include容器是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆