Skip to content

Commit b4ced7b

Browse files
committed
Added in cspacers as a container spacer measurement. Used this measurement as part of general grid streamlines/updates.
1 parent bea017f commit b4ced7b

File tree

6 files changed

+63
-38
lines changed

6 files changed

+63
-38
lines changed

default.ascx

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
<div class="container">
2424
<div class="row">
25-
<div id="DoublePaneOneOne" class="col-md-6 pr-5" runat="server"></div>
26-
<div id="DoublePaneOneTwo" class="col-md-6 bg-light-grey" runat="server"></div>
25+
<div id="DoublePaneOneOne" class="col-md-6 cpr-5" runat="server"></div>
26+
<div id="DoublePaneOneTwo" class="col-md-6 bg-light-grey cp-5" runat="server"></div>
2727
</div>
2828
</div>
2929

3030
<div class="container-fluid bg-tertiary">
3131
<div class="container">
3232
<div class="row align-items-center">
33-
<div id="FullWidthBGDoublePaneOne" class="col-md-6" runat="server"></div>
33+
<div id="FullWidthBGDoublePaneOne" class="col-md-6 cpy-5" runat="server"></div>
3434
<div id="FullWidthBGDoublePaneTwo" class="col-md-6" runat="server"></div>
3535
</div>
3636
</div>

src/scss/components/_grid.scss

+15-30
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,28 @@
1-
// Bootstrap Grid Changes
2-
3-
/* Changes the default gutter size */
4-
$xgutter:2rem;
5-
$ygutter:4rem;
6-
7-
// Sets gutters on all cols
8-
[class^='col-'] {
9-
padding-left:$xgutter;
10-
padding-right:$xgutter;
11-
margin-top:$ygutter;
12-
margin-bottom:$ygutter;
131
}
142

15-
@each $breakpoint in $breakpoints {
16-
$size: nth($breakpoint, 1);
17-
$width: nth($breakpoint, 2);
3+
// Pulls information for each breakpoint
4+
@each $size, $width in $breakpoints {
185

19-
// Upon collapse of cols at the appropriate breakpoint, adds a margin
6+
// Upon collapse of cols at the appropriate breakpoint:
207
@include mq-max-width($width) {
8+
9+
// adds a margin to the top cols that come after cols
2110
[class^='col-#{$size}'] + [class^='col-#{$size}'] {
22-
margin-top:0;
23-
margin-bottom:$ygutter;
11+
margin-top:($cspacer * 2);
2412
}
25-
.container {
26-
max-width:1200px;
13+
14+
// adds padding to the child div of the col to even spacing
15+
.container [class^="col-#{$size}"] > div {
16+
padding-left:$cspacer !important;
17+
padding-right:$cspacer !important;
2718
}
19+
20+
// removes padding for container within fluid container
2821
.container-fluid .container {
2922
padding:0;
23+
}
3024

31-
.row {
32-
margin-left:0;
33-
margin-right:0;
3425
}
3526
}
36-
// Adds the gutter to the left and right when collapsed
37-
[class^='col-'] {
38-
padding-left:$xgutter;
39-
padding-right:$xgutter;
40-
}
4127
}
42-
}
43-
28+
}

src/scss/components/_helpers.scss

+28-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
/* Position */
1+
// position
22
.pos-relative{
33
position: relative
44
}
55

6-
/* Cover Links */
6+
// cover links
77
.cover-link {
88
position:absolute;
99
top:0;
@@ -13,10 +13,10 @@
1313
z-index:100;
1414
}
1515

16-
/* BG Color Helpers */
16+
// bg colors
1717
[class*="bg-"] {
1818
color:white;
19-
19+
2020
&[class*="-primary"] {
2121
background-color:$primary-color !important;
2222
}
@@ -33,4 +33,28 @@
3333
pre {
3434
background:white;
3535
}
36+
}
37+
38+
// padding on div below contentpane
39+
// usage: adding cpy-4 class to a div would add padding to top and bottom of the div underneath it
40+
// mostly useful for cols with a bg color
41+
@each $size, $length in $cspacers {
42+
43+
.cp-#{$size} > div { padding: $length !important; }
44+
.cpt-#{$size} > div,
45+
.cpy-#{$size} > div {
46+
padding-top: $length !important;
47+
}
48+
.cpr-#{$size} > div,
49+
.cpx-#{$size} > div {
50+
padding-right: $length !important;
51+
}
52+
.cpb-#{$size} > div,
53+
.cpy-#{$size} > div {
54+
padding-bottom: $length !important;
55+
}
56+
.cpl-#{$size} > div,
57+
.cpx-#{$size} > div {
58+
padding-left: $length !important;
59+
}
3660
}

src/scss/variables/_breakpoints.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// A copy of the bootstrap 4 breakpoints
12
$breakpoints: (
23
"sm":576,
34
"md":768,

src/scss/variables/_spacing.scss

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Spacing for container padding helpers
2+
3+
$cspacer: 1rem !default;
4+
$cspacers: () !default;
5+
$cspacers: map-merge((
6+
0: 0,
7+
1: ($cspacer * .25),
8+
2: ($cspacer * .5),
9+
3: $cspacer,
10+
4: ($cspacer * 1.5),
11+
5: ($cspacer * 2),
12+
6: ($cspacer * 3),
13+
7: ($cspacer * 4),
14+
), $cspacers);

src/scss/variables/_variables.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
@import 'breakpoints';
21
@import 'colors';
2+
@import 'breakpoints';
3+
@import 'spacing';
34
@import 'type';

0 commit comments

Comments
 (0)