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

Commit 37a3e43

Browse files
author
Luke Harrison
committed
Tweaked spacing logic for grid system. Added new grid-system settings file
1 parent 3359fe0 commit 37a3e43

6 files changed

Lines changed: 32 additions & 19 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//--------------------------------------------------------------------------------------------------------------------------------------
2+
// GRID SYSTEM
3+
//--------------------------------------------------------------------------------------------------------------------------------------
4+
5+
/*
6+
Here we can define settings which alter the default state of the grid system - represented by the o-container
7+
and o-layout objects.
8+
*/
9+
10+
11+
// DEFAULT GUTTER SIZE
12+
//--------------------------------------------------------------------------------------------------------------------------------------
13+
14+
/*
15+
This defines default gutter size for o-container and o-layout. Additional sizings can be added via their
16+
spacing modifiers
17+
*/
18+
19+
$gutter: 20px;

05 - objects/_objects.container.scss

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,38 +22,37 @@ form a grid system.
2222

2323
.o-container {
2424
@include clearfix();
25-
box-sizing:content-box;
2625
margin-right: auto;
2726
margin-left: auto;
2827
max-width: rem(1170px);
29-
padding-left: rem(15px);
30-
padding-right: rem(15px);
28+
padding-left: rem($gutter);
29+
padding-right: rem($gutter);
3130
}
3231

3332

3433
// OUTER PADDING MODIFIERS
3534
//--------------------------------------------------------------------------------------------------------------------------------------
3635

3736
/*
38-
Modifiers to tweak the containers outer padding.
37+
Modifiers to tweak the containers outer spacing.
3938
*/
4039

4140
// Generate using settings.spacing
42-
// Example: o-container-padding-small
41+
// Example: o-container-spacing-small
4342
@each $sp-name, $sp-value in $spacing {
44-
.o-container--padding-#{$sp-name} {
43+
.o-container--spacing-#{$sp-name} {
4544
padding-left:rem($sp-value);
4645
padding-right:rem($sp-value);
4746
}
4847
}
4948

5049
// Create responsive variants using settings.breakpoints
51-
// Changes outer padding when breakpoint is hit
52-
// Example: o-container-padding-small@md
50+
// Changes outer spacing when breakpoint is hit
51+
// Example: o-container-spacing-small@md
5352
@each $bp-name, $bp-value in $breakpoints {
5453
@include bp(#{$bp-name}) {
5554
@each $sp-name, $sp-value in $spacing {
56-
.o-container--padding-#{$sp-name}\@#{$bp-name} {
55+
.o-container--spacing-#{$sp-name}\@#{$bp-name} {
5756
padding-left:rem($sp-value);
5857
padding-right:rem($sp-value);
5958
}
@@ -62,12 +61,12 @@ Modifiers to tweak the containers outer padding.
6261
}
6362

6463
// Create responsive variants using settings.breakpoints
65-
// Changes outer padding until breakpoint is hit
66-
// Example: o-container-padding-small@max-md
64+
// Changes outer spacing until breakpoint is hit
65+
// Example: o-container-spacing-small@max-md
6766
@each $bp-name, $bp-value in $breakpoints {
6867
@include bpMax(#{$bp-name}) {
6968
@each $sp-name, $sp-value in $spacing {
70-
.o-container--padding-#{$sp-name}\@max-#{$bp-name} {
69+
.o-container--spacing-#{$sp-name}\@max-#{$bp-name} {
7170
padding-left:rem($sp-value);
7271
padding-right:rem($sp-value);
7372
}

05 - objects/_objects.layout.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ The layout object is used to construct a grid-like layout system, with each layo
77
individual column. Typically used with container object and width utilities to form a grid system.
88
*/
99

10-
// OPTIONS
11-
//--------------------------------------------------------------------------------------------------------------------------------------
12-
13-
// Define default gutter width
14-
$gutter: 30px;
15-
1610

1711
// BASE & ELEMENTS
1812
//--------------------------------------------------------------------------------------------------------------------------------------

sample.main-orion-framework.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ OrionCSS in this way, you should use the 'sample.main.scss' file instead.
4141
@import "../../node_modules/orioncss/01 - settings/settings.spacing";
4242
@import "../../node_modules/orioncss/01 - settings/settings.typography";
4343
@import "../../node_modules/orioncss/01 - settings/settings.widths";
44+
@import "../../node_modules/orioncss/01 - settings/settings.grid-system";
4445
@import "01 - settings/*";
4546

4647
// Tools

sample.main.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This is the main file where all the different components of OrionCSS are brought
4141
@import "../../node_modules/orioncss/01 - settings/settings.spacing";
4242
@import "../../node_modules/orioncss/01 - settings/settings.typography";
4343
@import "../../node_modules/orioncss/01 - settings/settings.widths";
44+
@import "../../node_modules/orioncss/01 - settings/settings.grid-system";
4445
// @import "/01 - settings/settings.mysettings";
4546

4647
// Tools

test/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,5 @@
2121
</head>
2222
<body>
2323

24-
2524
</body>
2625
</html>

0 commit comments

Comments
 (0)