Skip to content
This repository was archived by the owner on Mar 13, 2019. It is now read-only.

Commit a8d5dd2

Browse files
author
Luke Harrison
committed
Added additional styles to media object to make SVG behaviour consistent with standard IMG. Tweaked default sizings for headings. Added breakout class to width utils. Added responsive versions of layout__item--fill. Added justify content styles to layout object
1 parent 1583f1e commit a8d5dd2

4 files changed

Lines changed: 171 additions & 12 deletions

File tree

04 - elements/_elements.headings.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ http://csswizardry.com/2016/02/managing-typography-on-large-apps/
1111

1212

1313
h1, h2, h3, h4, h5, h6 {
14-
font-size: 1.25rem;
15-
}
14+
font-size: 1rem;
15+
}

05 - objects/_objects.layout.scss

Lines changed: 138 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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
/*
5555
Tweak 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
/*
112112
Flush 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
/*
154154
Modifier 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
/*
162178
Makes 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

05 - objects/_objects.media.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,16 @@ http://csswizardry.com/2013/05/the-flag-object/
3535
width: auto;
3636
}
3737

38-
.o-media__image, .o-media__body {
38+
.o-media__image,
39+
.o-media__body {
3940
display: table-cell;
4041
vertical-align: middle;
4142
}
4243

4344
.o-media__image {
4445
width:rem(1px); /* [1] */
45-
img {
46+
img,
47+
svg {
4648
display: block;
4749
max-width: none;
4850
}

07 - utilities/_utilities.widths.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ Numbers are based on values in settings.spacing
100100
max-width:100% !important;
101101
}
102102

103+
104+
// Breaks out of containers with to go full width
105+
.u-breakout {
106+
width: 100vw;
107+
position: relative;
108+
left: 50%;
109+
right: 50%;
110+
margin-left: -50vw;
111+
margin-right: -50vw;
112+
}
113+
103114
// Changes max-width when breakpoint is hit
104115
// Example: u-max-width-small@md
105116
// Example: u-full-width@md
@@ -114,6 +125,14 @@ Numbers are based on values in settings.spacing
114125
width:100% !important;
115126
max-width:100% !important;
116127
}
128+
.u-breakout\@#{$bp-name} {
129+
width: 100vw;
130+
position: relative;
131+
left: 50%;
132+
right: 50%;
133+
margin-left: -50vw;
134+
margin-right: -50vw;
135+
}
117136
}
118137
}
119138

@@ -131,5 +150,13 @@ Numbers are based on values in settings.spacing
131150
width:100% !important;
132151
max-width:100% !important;
133152
}
153+
.u-breakout\@max-#{$bp-name} {
154+
width: 100vw;
155+
position: relative;
156+
left: 50%;
157+
right: 50%;
158+
margin-left: -50vw;
159+
margin-right: -50vw;
160+
}
134161
}
135162
}

0 commit comments

Comments
 (0)