在媒体布局的文档中,您可以选择指定min-width
参数或layout
参数,或同时指定两者:
// $media-layout: <min-width> <layout> <max-width> <ie-fallback>;
// - You must supply either <min-width> or <layout>.
$media-layout: 12; // Use 12-col layout at matching min-width.
省略min-width
参数(如上所述)时,如何计算?min-width
是指定$column-width
的设定百分比吗?
我目前正在使用仅限min-width
的方法,因为它似乎是使用 Susy(最干净的)方法,但我实际上不确定它是如何工作的。
直接从 github 上的源代码:
// Neither $min nor $max:
// We can create a breakpoint based on the number of columns in the layout.
$min: fix-ems(container-outer-width($width: false));
当仅传递布局时,Susy 会创建最小宽度断点以匹配容器的宽度。如果未传递布局,则会调用 get-layout()
,这会查找第一个大于给定$min
值的布局。