@@ -39,7 +39,7 @@ individual column. Typically used with container object and width utilities to f
3939[1] Required in order to combine fluid widths with fixed gutters.
4040*/
4141
42- .o-layout__item {
42+ .o-layout__item {
4343 box-sizing :border-box ; /* [1] */
4444 width :100% ;
4545 vertical-align : top ;
@@ -53,7 +53,7 @@ individual column. Typically used with container object and width utilities to f
5353
5454/*
5555Tweak the spacing between individual columns
56- */
56+ */
5757
5858// Generate using settings.spacing
5959// Example o-layout--spacing-small
@@ -110,7 +110,7 @@ Tweak the spacing between individual columns
110110
111111/*
112112Flush removes the gutter between layout items.
113- */
113+ */
114114
115115/*
116116[1] Remove negative margins as we no longer have to absorb any paddings from columns
@@ -152,12 +152,28 @@ Flush removes the gutter between layout items.
152152
153153/*
154154Modifier to disable layout__item default width so they can be inline
155- */
155+ */
156156
157157.o-layout--inline .o-layout__item {
158158 width :auto ;
159159}
160160
161+ @each $bp-name , $bp-value in $mq-breakpoints {
162+ @include mq (#{$bp-name } ) {
163+ .o-layout--inline\@ #{$bp-name } .o-layout__item {
164+ width :auto ;
165+ }
166+ }
167+ }
168+
169+ @each $bp-name , $bp-value in $mq-breakpoints {
170+ @include mq ($until :#{$bp-name } ) {
171+ .o-layout--inline\@ max-#{$bp-name } .o-layout__item {
172+ width :auto ;
173+ }
174+ }
175+ }
176+
161177/*
162178Makes a layout item fill all avaiable space
163179*/
@@ -166,6 +182,22 @@ Makes a layout item fill all avaiable space
166182 flex-grow :1 ;
167183}
168184
185+ @each $bp-name , $bp-value in $mq-breakpoints {
186+ @include mq (#{$bp-name } ) {
187+ .o-layout__item--fill\@ #{$bp-name } {
188+ flex-grow :1 ;
189+ }
190+ }
191+ }
192+
193+ @each $bp-name , $bp-value in $mq-breakpoints {
194+ @include mq ($until :#{$bp-name } ) {
195+ .o-layout__item--fill\@ max-#{$bp-name } {
196+ flex-grow :1 ;
197+ }
198+ }
199+ }
200+
169201
170202// FIT MODIFIER
171203// --------------------------------------------------------------------------------------------------------------------------------------
@@ -256,7 +288,7 @@ Modifiers to change the vertical alignment of the whole layout or just individua
256288
257289.o-layout__item--top {
258290 align-self :flex-start ;
259- }
291+ }
260292
261293.o-layout--bottom {
262294 align-items :flex-end ;
@@ -274,7 +306,7 @@ Modifiers to change the vertical alignment of the whole layout or just individua
274306 align-self :center ;
275307}
276308
277- // Columns are align to match their baseline
309+ // Columns are align to match their baseline
278310.o-layout--baseline {
279311 align-items :baseline ;
280312}
@@ -313,7 +345,7 @@ Modifiers to change the vertical alignment of the whole layout or just individua
313345 align-self :center ;
314346 }
315347
316- // Columns are align to match their baseline
348+ // Columns are align to match their baseline
317349 .o-layout--baseline\@ #{$bp-name } {
318350 align-items :baseline ;
319351 }
@@ -354,7 +386,7 @@ Modifiers to change the vertical alignment of the whole layout or just individua
354386 align-self :center ;
355387 }
356388
357- // Columns are align to match their baseline
389+ // Columns are align to match their baseline
358390 .o-layout--baseline\@ max-#{$bp-name } {
359391 align-items :baseline ;
360392 }
@@ -366,6 +398,104 @@ Modifiers to change the vertical alignment of the whole layout or just individua
366398}
367399
368400
401+ // HORIZONTAL ALIGNMENT MODIFIERS
402+ // --------------------------------------------------------------------------------------------------------------------------------------
403+
404+ /*
405+ Modifiers to change the horizontal alignment of the whole layout or just individual columns
406+ */
407+
408+ // Default vertical alignment
409+ .o-layout--left {
410+ justify-content :flex-start ;
411+ }
412+
413+ .o-layout__item--left {
414+ justify-self :flex-start ;
415+ }
416+
417+ .o-layout--right {
418+ justify-content :flex-end ;
419+ }
420+
421+ .o-layout__item--right {
422+ justify-self :flex-end ;
423+ }
424+
425+ .o-layout--center {
426+ justify-content :center ;
427+ }
428+
429+ .o-layout__item--center {
430+ justify-self :center ;
431+ }
432+
433+ // Changes vertical-alignment when breakpoint is hit
434+ // Example: .o-layout--center@md
435+ // Example: .o-layout__item--center@md
436+ @each $bp-name , $bp-value in $mq-breakpoints {
437+ @include mq (#{$bp-name } ) {
438+ // Default vertical alignment
439+ .o-layout--left\@ #{$bp-name } {
440+ justify-content :flex-start ;
441+ }
442+
443+ .o-layout__item--left\@ #{$bp-name } {
444+ justify-self :flex-start ;
445+ }
446+
447+ .o-layout--right\@ #{$bp-name } {
448+ justify-content :flex-end ;
449+ }
450+
451+ .o-layout__item--right\@ #{$bp-name } {
452+ justify-self :flex-end ;
453+ }
454+
455+ .o-layout--center\@ #{$bp-name } {
456+ justify-content :center ;
457+ }
458+
459+ .o-layout__item--center\@ #{$bp-name } {
460+ justify-self :center ;
461+ }
462+ }
463+ }
464+
465+ // Changes vertical-alignment until breakpoint is hit
466+ // Example: .o-layout--center@max-md
467+ // Example: .o-layout__item--center@max-md
468+ @each $bp-name , $bp-value in $mq-breakpoints {
469+ @include mq ($until : #{$bp-name } ) {
470+ // Default vertical alignment
471+ .o-layout--left\@ max-#{$bp-name } {
472+ justify-content :flex-start ;
473+ }
474+
475+ .o-layout__item--left\@ max-#{$bp-name } {
476+ justify-self :flex-start ;
477+ }
478+
479+ .o-layout--right\@ max-#{$bp-name } {
480+ justify-content :flex-end ;
481+ }
482+
483+ .o-layout__item--right\@ max-#{$bp-name } {
484+ justify-self :flex-end ;
485+ }
486+
487+ .o-layout--center\@ max-#{$bp-name } {
488+ justify-content :center ;
489+ }
490+
491+ .o-layout__item--center\@ max-#{$bp-name } {
492+ justify-self :center ;
493+ }
494+
495+ }
496+ }
497+
498+
369499// ORDERING MODIFIERS
370500// --------------------------------------------------------------------------------------------------------------------------------------
371501
0 commit comments