summaryrefslogtreecommitdiff
path: root/_sass/common/classes/_grid.scss
diff options
context:
space:
mode:
authorKarl Hallsby <karl@hallsby.com>2020-09-27 14:31:36 -0500
committerKarl Hallsby <karl@hallsby.com>2020-09-27 14:32:00 -0500
commit61b34a5f260db45575d448d766ea29c0fb273ed3 (patch)
tree4ac84fa917df0c69fb0fc6d587750514e7d0d813 /_sass/common/classes/_grid.scss
parentc3cafe3c3817f52d4c588b5b0d6e71e07e06145e (diff)
Add jekyll-text-theme YAML files
Diffstat (limited to '_sass/common/classes/_grid.scss')
-rw-r--r--_sass/common/classes/_grid.scss80
1 files changed, 80 insertions, 0 deletions
diff --git a/_sass/common/classes/_grid.scss b/_sass/common/classes/_grid.scss
new file mode 100644
index 0000000..655c254
--- /dev/null
+++ b/_sass/common/classes/_grid.scss
@@ -0,0 +1,80 @@
+$grid-columns: 12;
+
+.grid-container {
+ @include overflow(hidden);
+}
+.cell {
+ min-width: 0;
+}
+
+@mixin make-cell($columns) {
+ @if $columns == "auto" {
+ @include flex(1 1 0);
+ width: auto;
+ } @else if $columns == "shrink" {
+ @include flex(0 0 auto);
+ width: auto;
+ } @else if $columns == "stretch" {
+ @include flex(1);
+ } @else {
+ @include flex(none);
+ width: percentage($columns / $grid-columns);
+ }
+}
+
+@mixin make-grid-cell($columns, $breakpoint) {
+ @include media-breakpoint-up($breakpoint) {
+ .cell--#{breakpoint-infix($breakpoint)}#{$columns} {
+ @include make-cell($columns);
+ }
+ }
+}
+
+.grid {
+ @include flexbox();
+ @include flex-wrap(wrap);
+ & > {
+ @each $breakpoint in map-keys($responsive) {
+ @for $i from 1 through $grid-columns {
+ @include make-grid-cell($i, $breakpoint);
+ }
+ @include make-grid-cell("auto", $breakpoint);
+ @include make-grid-cell("shrink", $breakpoint);
+ @include make-grid-cell("stretch", $breakpoint);
+ }
+ }
+}
+
+.grid--reverse {
+ flex-direction: row-reverse;
+}
+
+@mixin make-grid() {
+ $types: ("p");
+ $directions: ("x", "y", "");
+ $spacers: (0, 1, 2, 3, 4, 5);
+
+ @each $type in $types {
+ @each $direction in $directions {
+ @each $spacer in $spacers {
+ @if $direction == "" {
+ .grid--#{$type}-#{$spacer} {
+ @include make-spacing("m", "", $spacer, true);
+ .cell {
+ @include make-spacing($type, "", $spacer);
+ }
+ }
+ } @else {
+ .grid--#{$type}#{$direction}-#{$spacer} {
+ @include make-spacing("m", $direction, $spacer, true);
+ .cell {
+ @include make-spacing($type, $direction, $spacer);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+@include make-grid();