From 67b69a7884adfb8a9993e97aaa3fbccca25573f5 Mon Sep 17 00:00:00 2001 From: "DNZ\\paul" Date: Mon, 14 Aug 2017 10:53:08 +0200 Subject: [PATCH 1/2] Moved flexbox grid-utility classes from grid partial to utility partial and removed the grid dependency, so these classes can be used in a wider contect. --- sass/base/utility.scss | 37 +++++++++++++++++++++++++++++++++++++ sass/layout/grid.scss | 35 +---------------------------------- 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/sass/base/utility.scss b/sass/base/utility.scss index 6cac022..20c5111 100644 --- a/sass/base/utility.scss +++ b/sass/base/utility.scss @@ -165,6 +165,43 @@ .img-right img, .img-left img, .img-center img { display: block; margin: 0 auto .6; } .img-right figcaption, .img-left figcaption, .img-center figcaption { display: block; color: Gray; font-style: italic; } +/* Flexbox utility classes */ +.flex { + display: flex; +} + +.dir-row { flex-direction: row; } +.dir-row-reverse { flex-direction: row-reverse; } +.dir-column { flex-direction: column; } +.dir-column-reverse { flex-direction: column-reverse; } + +/* Grid wrapping */ +.wrap { flex-wrap: wrap; } +.nowrap { flex-wrap: nowrap; } + +/* Alignment */ + +/* Justify content */ +.jc-flex-start { justify-content: flex-start; } +.jc-flex-end { justify-content: flex-end; } +.jc-center { justify-content: center; } +.jc-space-around { justify-content: space-around; } +.jc-space-between { justify-content: space-between; } + +/* Align items */ +.ai-flex-start { align-items: flex-start; } +.ai-flex-end { align-items: flex-end; } +.ai-center { align-items: center; } +.ai-space-around { align-items: baseline; } +.ai-stretch { align-items: stretch; } + +/* Align content */ +.ac-flex-start { align-content: flex-start; } +.ac-flex-end { align-content: flex-end; } +.ac-center { align-content: center; } +.ac-space-around { align-content: space-around; } +.ac-space-between { align-content: space-between; } + @media only screen and (min-width: $b3) { .img-right { float: right; margin: .8rem 0 1.6rem 4.8rem; } .img-left { float: left; margin: .8rem 4.8rem 1.6rem 0; } diff --git a/sass/layout/grid.scss b/sass/layout/grid.scss index 07cf860..061b451 100644 --- a/sass/layout/grid.scss +++ b/sass/layout/grid.scss @@ -40,7 +40,7 @@ /* Make children of grid items equal height */ &-equal-height { - + > * { display: flex; @@ -58,39 +58,6 @@ display: block; } - - &.dir-row { flex-direction: row; } - &.dir-row-reverse { flex-direction: row-reverse; } - &.dir-column { flex-direction: column; } - &.dir-column-reverse { flex-direction: column-reverse; } - - /* Grid wrapping */ - &.wrap { flex-wrap: wrap; } - &.nowrap { flex-wrap: nowrap; } - - /* Alignment */ - - /* Justify content */ - &.jc-flex-start { justify-content: flex-start; } - &.jc-flex-end { justify-content: flex-end; } - &.jc-center { justify-content: center; } - &.jc-space-around { justify-content: space-around; } - &.jc-space-between { justify-content: space-between; } - - /* Align items */ - &.ai-flex-start { align-items: flex-start; } - &.ai-flex-end { align-items: flex-end; } - &.ai-center { align-items: center; } - &.ai-space-around { align-items: baseline; } - &.ai-stretch { align-items: stretch; } - - /* Align content */ - &.ac-flex-start { align-content: flex-start; } - &.ac-flex-end { align-content: flex-end; } - &.ac-center { align-content: center; } - &.ac-space-around { align-content: space-around; } - &.ac-space-between { align-content: space-between; } - /* Grid items Every direct child within .g is a grid item Used to be .gi, the new method is less susceptible to errors From 8eafe2e43f42caf578cf095134e757b9410ad039 Mon Sep 17 00:00:00 2001 From: Pascal Alferink Date: Wed, 14 Feb 2018 13:42:51 +0100 Subject: [PATCH 2/2] classes .fw-wrap and .fw-nowrap in utility.scss and classes .wrap and .nowrap in grid.scss --- sass/base/utility.scss | 4 ++-- sass/layout/grid.scss | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sass/base/utility.scss b/sass/base/utility.scss index 20c5111..ad5d849 100644 --- a/sass/base/utility.scss +++ b/sass/base/utility.scss @@ -176,8 +176,8 @@ .dir-column-reverse { flex-direction: column-reverse; } /* Grid wrapping */ -.wrap { flex-wrap: wrap; } -.nowrap { flex-wrap: nowrap; } +.fw-wrap { flex-wrap: wrap; } +.fw-nowrap { flex-wrap: nowrap; } /* Alignment */ diff --git a/sass/layout/grid.scss b/sass/layout/grid.scss index 061b451..f634170 100644 --- a/sass/layout/grid.scss +++ b/sass/layout/grid.scss @@ -58,6 +58,10 @@ display: block; } + /* Grid wrapping */ + &.wrap { flex-wrap: wrap; } + &.nowrap { flex-wrap: nowrap; } + /* Grid items Every direct child within .g is a grid item Used to be .gi, the new method is less susceptible to errors