Singularitygs: Mobile grid persisting all screen sizes

不想你离开。 提交于 2019-12-02 00:44:31

It is not enough to define grid context.

In order for your responsive grids to work, you have to explicitly use them, e. g.:

@import "breakpoint";
@import "singularitygs";

@include add-grid(3);
@include add-grid(6 at 320px);
@include add-grid(12 at 740px);
@include add-gutter(1/3);

@include add-gutter(0.25);

.foo {

  background-color: deeppink;
  min-height: 10em;

  // Mobile grid
  @include float-span(1);

  // Medium grid
  @include breakpoint(320px) {
    @include float-span(1);
  }

  // Large grid
  @include breakpoint(740px) {
    @include float-span(1);
  }
}

Note that spans leak from smaller breakpoints into larger ones, and, unless overridden, they will mess your layout. In order to avoid that, set media queries with both min-width and max-width. Refer to Breakpoint documentation for details.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!