Skip to content

Commit 8ea7da7

Browse files
committed
new grid.css and grid-plus.css file exports
1 parent ee120b2 commit 8ea7da7

File tree

5 files changed

+64
-58
lines changed

5 files changed

+64
-58
lines changed

_config.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<meta name="author" content="Dave Berning">
99

1010
<link href="https://fonts.googleapis.com/css?family=Montserrat:500,700,900&display=swap" rel="stylesheet">
11-
<link rel="stylesheet" href="../dist/main.css">
11+
<link rel="stylesheet" href="../dist/grid.css">
1212
<link rel="stylesheet" href="styles.css">
1313
</head>
1414

@@ -29,6 +29,7 @@
2929
<p class="has-p has-no-m is-aligned-center">Column 10</p>
3030
<p class="has-p has-no-m is-aligned-center">Column 11</p>
3131
<p class="has-p has-no-m is-aligned-center">Column 12</p>
32+
<p class="has-p has-no-m is-aligned-center">Column 13</p>
3233
</div>
3334
</div>
3435
</body>

src/scss/includes/grid-plus.scss

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
@import '../variables';
2+
@import './../includes/functions';
3+
@import 'grid';
4+
5+
/* Class Generation
6+
------------------------- */
7+
@mixin generate_gap($grid_direction) {
8+
// Generate Grid Gap Classes --- Ex: .has-col-gap-md (medium column gap
9+
$first_letters_of_direction: get_first_chars($grid_direction, 3);
10+
11+
@each $size in $sizes {
12+
@each $direction in $grid_direction {
13+
.has-#{$first_letters_of_direction}-gap#{$size} {
14+
grid-#{$direction}-gap: variable(#{'spacing#{$size}'});
15+
}
16+
}
17+
}
18+
19+
// No Col/Row Gap Class --- Ex: .has-no-col-gap
20+
.has-no-#{$first_letters_of_direction}-gap { grid-#{$grid_direction}-gap: 0; }
21+
}
22+
23+
@mixin generate_direction($direction) {
24+
// Generate Direction Classes --- Ex: .is-rtl or .is-ltr
25+
@for $i from 1 through length($breakpoints) {
26+
.is-#{$direction} { direction: #{$direction}; }
27+
.is-#{$direction}-#{nth($breakpoints, $i)} {
28+
@media screen and (min-width: #{nth($breakpoint_values, $i)}) { direction: #{$direction}; }
29+
}
30+
}
31+
}
32+
33+
@mixin generate_place_self() {
34+
// Generate Place Self Classes --- Ex: .is-placed-left
35+
@each $property in $properties {
36+
.is-placed-#{$property} {
37+
place-self: #{$property};
38+
}
39+
}
40+
}
41+
42+
@mixin generate_order_classes($grid_direction) {
43+
// Generate Order Classes --- Ex: is-order-2-lg
44+
@for $i from 1 through $maximum {
45+
.is-order-#{$i} { order: #{$i}; }
46+
47+
@for $b from 1 through length($breakpoints) {
48+
.is-order-#{$i}-#{nth($breakpoints, $b)} {
49+
@media screen and (min-width: #{nth($breakpoint_values, $b)}) { order: #{$i} }
50+
}
51+
}
52+
}
53+
}
54+
55+
@include generate_gap("row");
56+
@include generate_gap("column");
57+
@include generate_direction("ltr");
58+
@include generate_direction("rtl");
59+
@include generate_place_self;
60+
@include generate_order_classes("row");
61+
@include generate_order_classes("column");

src/scss/includes/grid.scss

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -59,54 +59,6 @@
5959
}
6060
}
6161

62-
@mixin generate_gap($grid_direction) {
63-
// Generate Grid Gap Classes --- Ex: .has-col-gap-md (medium column gap
64-
$first_letters_of_direction: get_first_chars($grid_direction, 3);
65-
66-
@each $size in $sizes {
67-
@each $direction in $grid_direction {
68-
.has-#{$first_letters_of_direction}-gap#{$size} {
69-
grid-#{$direction}-gap: variable(#{'spacing#{$size}'});
70-
}
71-
}
72-
}
73-
74-
// No Col/Row Gap Class --- Ex: .has-no-col-gap
75-
.has-no-#{$first_letters_of_direction}-gap { grid-#{$grid_direction}-gap: 0; }
76-
}
77-
78-
@mixin generate_direction($direction) {
79-
// Generate Direction Classes --- Ex: .is-rtl or .is-ltr
80-
@for $i from 1 through length($breakpoints) {
81-
.is-#{$direction} { direction: #{$direction}; }
82-
.is-#{$direction}-#{nth($breakpoints, $i)} {
83-
@media screen and (min-width: #{nth($breakpoint_values, $i)}) { direction: #{$direction}; }
84-
}
85-
}
86-
}
87-
88-
@mixin generate_place_self() {
89-
// Generate Place Self Classes --- Ex: .is-placed-left
90-
@each $property in $properties {
91-
.is-placed-#{$property} {
92-
place-self: #{$property};
93-
}
94-
}
95-
}
96-
97-
@mixin generate_order_classes($grid_direction) {
98-
// Generate Order Classes --- Ex: is-order-2-lg
99-
@for $i from 1 through $maximum {
100-
.is-order-#{$i} { order: #{$i}; }
101-
102-
@for $b from 1 through length($breakpoints) {
103-
.is-order-#{$i}-#{nth($breakpoints, $b)} {
104-
@media screen and (min-width: #{nth($breakpoint_values, $b)}) { order: #{$i} }
105-
}
106-
}
107-
}
108-
}
109-
11062
/* Grid
11163
------------------------ */
11264
.is-grid,
@@ -150,13 +102,6 @@
150102
display: inline-grid !important;
151103
}
152104

153-
@include generate_gap("row");
154-
@include generate_gap("column");
155-
@include generate_direction("ltr");
156-
@include generate_direction("rtl");
157-
@include generate_place_self;
158-
@include generate_order_classes("row");
159-
@include generate_order_classes("column");
160105
@include grid_has("rows");
161106
@include grid_has("columns");
162107
@include grid_item_spans("row")

src/scss/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@
2121

2222
/* Grid
2323
------------------ */
24-
@import 'includes/grid';
24+
@import 'includes/grid-plus';
2525
@import 'includes/flexbox';

0 commit comments

Comments
 (0)