app/assets/stylesheets/material/mixin/_grid.scss in material-sass-0.0.1 vs app/assets/stylesheets/material/mixin/_grid.scss in material-sass-0.0.2
- old
+ new
@@ -1,5 +1,27 @@
+@mixin make-container() {
+ margin-right: auto;
+ margin-left: auto;
+ padding-right: $grid-gutter;
+ padding-left: $grid-gutter;
+ @include clearfix();
+ // 992
+ @include responsive(md) {
+ max-width: ($screen-md - $grid-gutter * 2);
+ }
+ // 1440
+ @include responsive(lg) {
+ max-width: ($screen-lg - $grid-gutter * 2);
+ }
+}
+
+@mixin make-row() {
+ margin-right: ($grid-gutter * -1);
+ margin-left: ($grid-gutter * -1);
+ @include clearfix();
+}
+
// col
@mixin calc-col($index, $class, $type) {
@if ($type == colwidth) and ($index > 0) {
.col-#{$class}-#{$index} {
width: percentage(($index / $grid-cols));
@@ -19,29 +41,32 @@
.col-#{$class}-push-#{$index} {
left: percentage(($index / $grid-cols));
}
}
}
+
@mixin float-col($class) {
$i: 1;
- $list: '';
+ $list: "";
$list: ".col-#{$class}-#{$i}";
@for $i from (1 + 1) through $grid-cols {
$list: "#{$list}, .col-#{$class}-#{$i}";
}
#{$list} {
float: left;
}
}
+
@mixin loop-col($columns, $class, $type) {
@for $i from 0 through $columns {
@include calc-col($i, $class, $type);
}
}
+
@mixin make-col() {
$i: 1;
- $list: '';
+ $list: "";
$list: ".col-xx-#{$i}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
@for $i from (1 + 1) through $grid-cols {
$list: "#{$list}, .col-xx-#{$i}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
}
#{$list} {
@@ -49,34 +74,13 @@
position: relative;
padding-left: $grid-gutter;
padding-right: $grid-gutter;
}
}
+
@mixin make-grid($class) {
@include float-col($class);
@include loop-col($grid-cols, $class, colwidth);
@include loop-col($grid-cols, $class, offset);
@include loop-col($grid-cols, $class, pull);
@include loop-col($grid-cols, $class, push);
- }
-
-// container and row
- @mixin make-container() {
- margin-right: auto;
- margin-left: auto;
- padding-right: $grid-gutter;
- padding-left: $grid-gutter;
- @include clearfix();
- // 992
- @include responsive(md) {
- width: ($screen-md - $grid-gutter * 2);
- }
- // 1440
- @include responsive(lg) {
- width: ($screen-lg - $grid-gutter * 2);
- }
- }
- @mixin make-row() {
- margin-right: ($grid-gutter * -1);
- margin-left: ($grid-gutter * -1);
- @include clearfix();
}
\ No newline at end of file