stratum 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.editorconfig +7 -0
- data/.gitignore +2 -2
- data/assets/stylesheets/_css3.scss +7 -0
- data/assets/stylesheets/_helpers.scss +7 -0
- data/assets/stylesheets/_stratum.scss +12 -15
- data/assets/stylesheets/css3/_border-radius.scss +2 -2
- data/assets/stylesheets/css3/_user-select.scss +12 -0
- data/assets/stylesheets/helpers/_box.scss +17 -0
- data/assets/stylesheets/{addons → helpers}/_dimensions.scss +7 -4
- data/assets/stylesheets/{addons → helpers}/_group.scss +0 -0
- data/assets/stylesheets/helpers/_icon-map.scss +11 -0
- data/assets/stylesheets/helpers/_icons.scss +177 -0
- data/assets/stylesheets/{addons → helpers}/_position.scss +6 -6
- data/assets/stylesheets/helpers/_triangle.scss +64 -0
- data/assets/stylesheets/{addons → helpers}/_vendor-prefix.scss +0 -0
- data/assets/stylesheets/layout/_grid.scss +4 -5
- data/assets/stylesheets/layout/{_grid-functions.scss → grid/_functions.scss} +12 -11
- data/assets/stylesheets/layout/grid/_guides.scss +123 -0
- data/assets/stylesheets/layout/grid/_mixins.scss +83 -0
- data/assets/stylesheets/layout/grid/_semantics.scss +5 -0
- data/assets/stylesheets/layout/grid/semantics/_core.scss +96 -0
- data/assets/stylesheets/layout/grid/semantics/_nested.scss +34 -0
- data/assets/stylesheets/layout/grid/semantics/_offsets.scss +50 -0
- data/assets/stylesheets/layout/grid/semantics/_overrides.scss +71 -0
- data/assets/stylesheets/layout/grid/semantics/_subdivisions.scss +16 -0
- data/assets/stylesheets/layout/scaffolding.scss +105 -52
- data/bin/stratum +1 -1
- data/lib/stratum/generator.rb +74 -0
- data/lib/stratum/version.rb +3 -0
- data/lib/stratum.rb +2 -73
- data/stratum.gemspec +1 -1
- metadata +27 -38
- data/.gitmodules +0 -3
- data/assets/stylesheets/layout/_grid-guides.scss +0 -93
- data/assets/stylesheets/layout/_grid-mixins.scss +0 -79
- data/assets/stylesheets/layout/_grid-semantics.scss +0 -266
- data/lib/version.rb +0 -3
- data/tests/Gemfile +0 -6
- data/tests/Gemfile.lock +0 -63
- data/tests/Guardfile +0 -11
- data/tests/_config.yml +0 -5
- data/tests/_includes/menu-grids.html +0 -9
- data/tests/_includes/shared-grid-samples.html +0 -58
- data/tests/_layouts/default.html +0 -21
- data/tests/grid/arstechnica.html +0 -70
- data/tests/grid/bbc.html +0 -74
- data/tests/grid/fluid.html +0 -85
- data/tests/grid/guardian.html +0 -248
- data/tests/grid/index.html +0 -5
- data/tests/grid/pixel.html +0 -29
- data/tests/images/arstechnica.png +0 -0
- data/tests/images/bbc.png +0 -0
- data/tests/images/capture.js +0 -15
- data/tests/images/guardian-home.png +0 -0
- data/tests/scss/_mock-block.scss +0 -68
- data/tests/scss/arstechnica.scss +0 -106
- data/tests/scss/bbc.scss +0 -93
- data/tests/scss/fluid-grid.scss +0 -50
- data/tests/scss/guardian.scss +0 -219
- data/tests/scss/main.scss +0 -90
- data/tests/scss/pixel-grid.scss +0 -14
data/.editorconfig
ADDED
data/.gitignore
CHANGED
@@ -1,28 +1,25 @@
|
|
1
1
|
// Grid settings
|
2
|
-
$grid-guides-color: #8aa8c0 !default;
|
3
|
-
$grid-guides-opacity: .2 !default;
|
4
|
-
$grid-guides-position: front !default;
|
5
2
|
$grid-type: fluid !default;
|
6
3
|
$grid-size: 980px !default;
|
7
4
|
$grid-total-columns: 12 !default;
|
8
5
|
$grid-desired-gutter: 20px !default;
|
9
6
|
$grid-baseline: 18px !default;
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
// Grid guides
|
9
|
+
$grid-guides-class: false !default; // Adds `.m-show-guides` and `.m-show-guides.m-front` to scaffolding
|
10
|
+
$grid-guides-color: #8aa8c0 !default;
|
11
|
+
$grid-guides-opacity: .2 !default;
|
12
|
+
$grid-guides-position: front !default;
|
15
13
|
|
16
|
-
//
|
17
|
-
|
18
|
-
@import "css3/border-radius";
|
19
|
-
@import "css3/box-sizing";
|
20
|
-
@import "css3/transform";
|
21
|
-
@import "css3/transition";
|
14
|
+
// Scaffolding
|
15
|
+
$scaffolding-debug: true !default; // Highlight disabled features that are used
|
22
16
|
|
23
|
-
|
17
|
+
@import "css3";
|
18
|
+
@import "helpers";
|
24
19
|
@import "layout/grid";
|
25
|
-
// @import "layout/responsive";
|
26
20
|
|
27
21
|
// Forms
|
28
22
|
@import "forms/input-placeholder";
|
23
|
+
|
24
|
+
// Icons
|
25
|
+
$stratum-icons: $stratum-dingbats !default;
|
@@ -22,8 +22,8 @@
|
|
22
22
|
// values (such as 30px/60px) need to be quoted: "30px/30px"
|
23
23
|
|
24
24
|
@mixin border-radius($value...) {
|
25
|
-
|
26
|
-
@include vendor-prefix(border-radius, unquote(
|
25
|
+
$-value: nth($value, 1);
|
26
|
+
@include vendor-prefix(border-radius, unquote($-value), webkit spec);
|
27
27
|
|
28
28
|
@if length($value) > 1 and nth($value, 2) == clip {
|
29
29
|
@include vendor-prefix(background-clip, padding-box, webkit spec);
|
@@ -0,0 +1,17 @@
|
|
1
|
+
// Dimensions helpers
|
2
|
+
// ------------------
|
3
|
+
|
4
|
+
// Box element
|
5
|
+
// <width>, <height>
|
6
|
+
// If one parameter is specified, make square
|
7
|
+
@mixin box($args...) {
|
8
|
+
@if nth($args, 1) == center {
|
9
|
+
margin-left: auto;
|
10
|
+
margin-right: auto;
|
11
|
+
} @else if length($args) < 3 {
|
12
|
+
width: nth($args, 1);
|
13
|
+
height: nth($args, length($args));
|
14
|
+
} @else {
|
15
|
+
@warn "box mixin only takes 1 or 2 arguments"
|
16
|
+
}
|
17
|
+
}
|
@@ -4,10 +4,13 @@
|
|
4
4
|
// Box element
|
5
5
|
// <width>, <height>
|
6
6
|
// If one parameter is specified, make square
|
7
|
-
@mixin box($
|
8
|
-
@if
|
9
|
-
|
10
|
-
|
7
|
+
@mixin box($args...) {
|
8
|
+
@if $args == center {
|
9
|
+
margin-left: auto;
|
10
|
+
margin-right: auto;
|
11
|
+
} @else if length($args) < 3 {
|
12
|
+
width: nth($args, 1);
|
13
|
+
height: nth($args, length($args));
|
11
14
|
} @else {
|
12
15
|
@warn "box mixin only takes 1 or 2 arguments"
|
13
16
|
}
|
File without changes
|
@@ -0,0 +1,177 @@
|
|
1
|
+
// Icon helpers
|
2
|
+
// ------------
|
3
|
+
// Adds inline icon to an element
|
4
|
+
|
5
|
+
// Icons are mapped to default fallback list defined in `icon-map`
|
6
|
+
|
7
|
+
@import "icon-map";
|
8
|
+
|
9
|
+
// Default global icons can be easily overriden by importing a new map
|
10
|
+
// and assigning it to default `$stratum-icons` variable:
|
11
|
+
|
12
|
+
// e.g.
|
13
|
+
// ```
|
14
|
+
// @import "font-awesome";
|
15
|
+
// $stratum-icons: $icons-font-awesome;
|
16
|
+
// ```
|
17
|
+
|
18
|
+
// Alternatively, font icons can be provided inline for each icon
|
19
|
+
// e.g.
|
20
|
+
// ```
|
21
|
+
// @include icon(music, $source: $icons-font-awesome);
|
22
|
+
// ```
|
23
|
+
|
24
|
+
// Placeholder for shared classes
|
25
|
+
%-icon-inline {
|
26
|
+
line-height: 1;
|
27
|
+
display: inline-block;
|
28
|
+
text-align: center;
|
29
|
+
-webkit-font-smoothing: antialiased;
|
30
|
+
}
|
31
|
+
%-icon-only {
|
32
|
+
display: inline-block;
|
33
|
+
text-indent: -100%;
|
34
|
+
white-space: nowrap;
|
35
|
+
line-height: 1;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Function to map icon name to character/image
|
39
|
+
@function -icon-map($name, $source) {
|
40
|
+
@each $icon in $source {
|
41
|
+
@if length($icon) < 2 {
|
42
|
+
@warn "Icon value is missing for '#{$icon}'";
|
43
|
+
@return null;
|
44
|
+
}
|
45
|
+
|
46
|
+
$-name: nth($icon, 1);
|
47
|
+
$-value: nth($icon, 2);
|
48
|
+
|
49
|
+
@if $-name == $name {
|
50
|
+
@return $-value;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
@warn "Icon '#{$name}' not found";
|
54
|
+
@return "";
|
55
|
+
}
|
56
|
+
|
57
|
+
// Function to get font family from font map file
|
58
|
+
// (If font family is included as the last pair in the list)
|
59
|
+
// Expects the following format:
|
60
|
+
// ```
|
61
|
+
// $font-icon:
|
62
|
+
// ...
|
63
|
+
// -font FontAwesome;
|
64
|
+
// ```
|
65
|
+
|
66
|
+
@function -icon-font($source) {
|
67
|
+
$-font-family: null;
|
68
|
+
|
69
|
+
@if length($source) > 1 {
|
70
|
+
$-last-pair: nth($source, length($source));
|
71
|
+
|
72
|
+
@if length($-last-pair) == 2 and nth($-last-pair, 1) == "-font" {
|
73
|
+
$-font-family: nth($-last-pair, 2);
|
74
|
+
} @else {
|
75
|
+
@warn "No font speficied";
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
@return $-font-family;
|
80
|
+
}
|
81
|
+
|
82
|
+
// Icon properties mixin
|
83
|
+
// Returns inline icon styles and sets optional dimensions
|
84
|
+
@mixin -icon-render($size, $el, $font-family, $hide-text) {
|
85
|
+
@extend %-icon-inline;
|
86
|
+
|
87
|
+
font-size: $size;
|
88
|
+
font-family: $font-family;
|
89
|
+
|
90
|
+
@if not $hide-text {
|
91
|
+
@if $el == after {
|
92
|
+
margin-left: .4em;
|
93
|
+
} @else {
|
94
|
+
margin-right: .4em;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
// Vertically align if custom icon size specified
|
99
|
+
@if $size != inherit and not unitless($size) {
|
100
|
+
@include box($size);
|
101
|
+
}
|
102
|
+
}
|
103
|
+
|
104
|
+
// Include icon
|
105
|
+
// Main icon mixin
|
106
|
+
|
107
|
+
// Usage:
|
108
|
+
// ```
|
109
|
+
// @include icon(music, $source: $icons-font-awesome) {
|
110
|
+
// color: #444;
|
111
|
+
// text-shadow: 0 1px 2px #aaa;
|
112
|
+
// }
|
113
|
+
// ```
|
114
|
+
// Properties inside braces are optional
|
115
|
+
|
116
|
+
@mixin icon($name, $size: inherit, $el: before, $source: $stratum-icons, $hide-text: false) {
|
117
|
+
$-font-family: -icon-font($source);
|
118
|
+
|
119
|
+
@if $hide-text {
|
120
|
+
@extend %-icon-only;
|
121
|
+
}
|
122
|
+
|
123
|
+
@if $el == before or $el == after {
|
124
|
+
// Pseudo element
|
125
|
+
&::#{$el} {
|
126
|
+
@include -icon-render($size, $el, $-font-family, $hide-text);
|
127
|
+
content: quote(-icon-map($name, $source));
|
128
|
+
|
129
|
+
@if $hide-text {
|
130
|
+
text-indent: 0;
|
131
|
+
float: left;
|
132
|
+
}
|
133
|
+
|
134
|
+
@content;
|
135
|
+
}
|
136
|
+
} @else {
|
137
|
+
// HTML element
|
138
|
+
> #{$el} {
|
139
|
+
@include -icon-render($size, $el, $-font-family, $hide-text);
|
140
|
+
font-style: normal;
|
141
|
+
|
142
|
+
&::before {
|
143
|
+
content: quote(-icon-map($name, $source));
|
144
|
+
}
|
145
|
+
|
146
|
+
@if $hide-text {
|
147
|
+
text-indent: 0;
|
148
|
+
float: left;
|
149
|
+
}
|
150
|
+
|
151
|
+
@content;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
// Hide text and include icon only
|
157
|
+
@mixin icon-only($name, $size: inherit, $el: before, $source: $stratum-icons) {
|
158
|
+
@include icon($name, $size, $el, $source, $hide-text: true) {
|
159
|
+
@content;
|
160
|
+
}
|
161
|
+
}
|
162
|
+
|
163
|
+
// Mixin to adjust existing icon
|
164
|
+
// @include icon-edit {
|
165
|
+
// color: #444;
|
166
|
+
// text-shadow: 0 1px 2px #aaa;
|
167
|
+
// }
|
168
|
+
// ```
|
169
|
+
|
170
|
+
// `before` | `after` | `<el>` (direct descendant <element>)
|
171
|
+
@mixin icon-edit($el: before) {
|
172
|
+
@if $el == before or $el == after {
|
173
|
+
&::#{$el} { @content }
|
174
|
+
} @else {
|
175
|
+
> #{$el} { @content }
|
176
|
+
}
|
177
|
+
}
|
@@ -30,7 +30,7 @@
|
|
30
30
|
$values: append($values, nth($values, 2));
|
31
31
|
}
|
32
32
|
|
33
|
-
|
33
|
+
$-pairs:
|
34
34
|
top nth($values, 1),
|
35
35
|
right nth($values, 2),
|
36
36
|
bottom nth($values, 3),
|
@@ -38,11 +38,11 @@
|
|
38
38
|
|
39
39
|
position: $position;
|
40
40
|
|
41
|
-
@each $pair in
|
42
|
-
|
43
|
-
|
44
|
-
@if
|
45
|
-
#{
|
41
|
+
@each $pair in $-pairs {
|
42
|
+
$-pos: nth($pair, 1);
|
43
|
+
$-val: nth($pair, 2);
|
44
|
+
@if $-val == auto or ($-val != none and not unitless($-val)) {
|
45
|
+
#{$-pos}: $-val;
|
46
46
|
}
|
47
47
|
}
|
48
48
|
}
|
@@ -0,0 +1,64 @@
|
|
1
|
+
// Generate CSS triangles
|
2
|
+
// ----------------------
|
3
|
+
|
4
|
+
@mixin triangle($position: top, $color: black, $size: 16px) {
|
5
|
+
$-dimensions: null;
|
6
|
+
$-colors: null;
|
7
|
+
$-height: nth($size, 1);
|
8
|
+
$-left: $-height / 1.5;
|
9
|
+
$-right: $-height / 1.5;
|
10
|
+
|
11
|
+
// sides width specified
|
12
|
+
@if length($size) == 2 {
|
13
|
+
$-left: nth($size, 2);
|
14
|
+
$-right: nth($size, 2);
|
15
|
+
// individual side widths specified
|
16
|
+
} @else if length($size) == 3 {
|
17
|
+
$-left: nth($size, 2);
|
18
|
+
$-right: nth($size, 3);
|
19
|
+
}
|
20
|
+
|
21
|
+
@if $position == top {
|
22
|
+
$-dimensions: 0 $-right $-height $-left;
|
23
|
+
$-colors: transparent transparent $color;
|
24
|
+
}
|
25
|
+
@if $position == top-right {
|
26
|
+
$-dimensions: 0 $-height $-height 0;
|
27
|
+
$-colors: transparent $color transparent transparent;
|
28
|
+
}
|
29
|
+
@if $position == right {
|
30
|
+
$-dimensions: $-left 0 $-right $-height;
|
31
|
+
$-colors: transparent transparent transparent $color;
|
32
|
+
}
|
33
|
+
@if $position == bottom-right {
|
34
|
+
$-dimensions: 0 0 $-height $-height;
|
35
|
+
$-colors: transparent transparent $color;
|
36
|
+
}
|
37
|
+
@if $position == bottom {
|
38
|
+
$-dimensions: $-height $-left 0 $-right;
|
39
|
+
$-colors: $color transparent transparent;
|
40
|
+
}
|
41
|
+
@if $position == bottom-left {
|
42
|
+
$-dimensions: $-height 0 0 $-height;
|
43
|
+
$-colors: transparent transparent transparent $color;
|
44
|
+
}
|
45
|
+
@if $position == left {
|
46
|
+
$-dimensions: $-left $-height $-right 0;
|
47
|
+
$-colors: transparent $color transparent transparent;
|
48
|
+
}
|
49
|
+
@if $position == top-left {
|
50
|
+
$-dimensions: $-height $-height 0 0;
|
51
|
+
$-colors: $color transparent transparent transparent;
|
52
|
+
}
|
53
|
+
|
54
|
+
@if $-dimensions and $-colors {
|
55
|
+
@include box(0px);
|
56
|
+
display: inline-block;
|
57
|
+
border-style: solid;
|
58
|
+
border-width: $-dimensions;
|
59
|
+
border-color: $-colors;
|
60
|
+
} @else {
|
61
|
+
@warn "Unrecognised position '#{$position}'. Use one of: top, top-right, right, bottom-right, bottom, bottom-left, left, top-left";
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
File without changes
|
@@ -18,9 +18,8 @@ $grid-guides-color: #c84e5b !default;
|
|
18
18
|
$grid-guides-opacity: .2 !default;
|
19
19
|
$grid-guides-position: back !default;
|
20
20
|
|
21
|
+
@import "grid/functions";
|
22
|
+
@import "grid/mixins";
|
23
|
+
@import "grid/guides";
|
21
24
|
|
22
|
-
@import "grid
|
23
|
-
|
24
|
-
@import "grid-mixins";
|
25
|
-
@import "grid-semantics";
|
26
|
-
@import "grid-guides";
|
25
|
+
@import "grid/semantics";
|
@@ -6,23 +6,23 @@
|
|
6
6
|
// All parameters are optional (use grid defaults)
|
7
7
|
|
8
8
|
@function grid-column-gutter($grid-size: $grid-size, $desired: $grid-desired-gutter) {
|
9
|
-
|
9
|
+
$-gutter: 0px;
|
10
10
|
$column: 1;
|
11
11
|
|
12
12
|
// Find a round gutter width
|
13
|
-
@while $column >
|
14
|
-
$column: grid-column-width($grid-size, $grid-total-columns,
|
13
|
+
@while $column > $-gutter {
|
14
|
+
$column: grid-column-width($grid-size, $grid-total-columns, $-gutter);
|
15
15
|
|
16
16
|
@if $column % 1 == 0 {
|
17
17
|
$range-from: $desired - 6;
|
18
18
|
$range-to: $desired + 20;
|
19
|
-
$within-range:
|
19
|
+
$within-range: $-gutter >= $range-from and $-gutter <= $range-to;
|
20
20
|
// Find gutter within desired range
|
21
21
|
@if $within-range {
|
22
|
-
@return
|
22
|
+
@return $-gutter;
|
23
23
|
}
|
24
24
|
}
|
25
|
-
|
25
|
+
$-gutter: $-gutter + 1;
|
26
26
|
}
|
27
27
|
@warn "Couldn't find suitable gutter close to your desired value. Try a different one.";
|
28
28
|
}
|
@@ -41,19 +41,20 @@
|
|
41
41
|
// # Calculate the total width of number of columns including gutters
|
42
42
|
// `$column-width` & `$gutter` are optional (use grid defaults)
|
43
43
|
@function grid-columns-width($column-span, $column-width: auto, $gutter: auto, $type: $grid-type, $total-columns: $grid-total-columns) {
|
44
|
-
|
44
|
+
$-gutter: grid-column-gutter($grid-size, $grid-desired-gutter);
|
45
45
|
|
46
46
|
@if $gutter == 0 {
|
47
|
-
|
47
|
+
$-gutter: 0;
|
48
|
+
// Do not round because round values are optimised for grid with gutters
|
48
49
|
$column-width: grid-column-width($total-columns: $total-columns, $gutter: 0) * $column-span;
|
49
50
|
} @else {
|
50
|
-
$column-width: ceil($column-span * grid-column-width($total-columns: $total-columns) + (($column-span - 1) *
|
51
|
+
$column-width: ceil($column-span * grid-column-width($total-columns: $total-columns) + (($column-span - 1) * $-gutter));
|
51
52
|
}
|
52
53
|
|
53
|
-
|
54
|
+
$-grid-size: $grid-size + $-gutter;
|
54
55
|
|
55
56
|
@if $type == fluid {
|
56
|
-
$column-width: grid-percentage($column-width,
|
57
|
+
$column-width: grid-percentage($column-width, $-grid-size);
|
57
58
|
}
|
58
59
|
|
59
60
|
@return $column-width;
|
@@ -0,0 +1,123 @@
|
|
1
|
+
// Grid debugging tools: Guides
|
2
|
+
// ----------------------------
|
3
|
+
|
4
|
+
// ## Usage:
|
5
|
+
|
6
|
+
// Apply grid guide to all grids on page
|
7
|
+
// [optional] $element: container | row (default - container)
|
8
|
+
// [optional] $position: back | front (default - back)
|
9
|
+
// `@include GRID-GUIDES($el, $position);` // At the root of stylesheet
|
10
|
+
|
11
|
+
// Apply grid guide on element
|
12
|
+
// [optional] $position: back | front (default - back)
|
13
|
+
// ```
|
14
|
+
// .row {
|
15
|
+
// @include show-grid-guides($position);`
|
16
|
+
// }
|
17
|
+
|
18
|
+
// Guides rely on `::before` pseudo element so they will only work on elements
|
19
|
+
// that don't already use it (e.g. not `group(true)`)
|
20
|
+
|
21
|
+
// Draws grid guides
|
22
|
+
@mixin grid-render-guides($grid-size: $grid-size, $grid-type: $grid-type, $column-gutter: grid-column-gutter()) {
|
23
|
+
|
24
|
+
$-block-size: 8;
|
25
|
+
|
26
|
+
// Pixel grid default values
|
27
|
+
$-column-width: grid-column-width($gutter: $column-gutter);
|
28
|
+
$-column-combined-width: $column-gutter + $-column-width;
|
29
|
+
|
30
|
+
@if $grid-type == fluid {
|
31
|
+
// Calculate gutter to column ratio
|
32
|
+
$-gutter-ratio: $column-gutter / ($-column-width + $column-gutter);
|
33
|
+
// Calculate column to grid width ratio
|
34
|
+
// not entirely sure where $column-gutter/3 magic number comes from, but it's necessary to make it work
|
35
|
+
$-column-ratio: ($-column-width + $column-gutter) / ($grid-size - $column-gutter / 3);
|
36
|
+
|
37
|
+
// Reset column size with percentages
|
38
|
+
$column-gutter: percentage($-gutter-ratio);
|
39
|
+
$-column-width: 100 - percentage($-gutter-ratio);
|
40
|
+
$-column-combined-width: percentage($-column-ratio);
|
41
|
+
}
|
42
|
+
|
43
|
+
$column-gutter: $-column-width + $column-gutter;
|
44
|
+
$-block-height: (($grid-baseline + 1) * $-block-size) + $grid-baseline;
|
45
|
+
|
46
|
+
position: relative;
|
47
|
+
|
48
|
+
&:before {
|
49
|
+
content: " ";
|
50
|
+
position: absolute;
|
51
|
+
top: 0;
|
52
|
+
left: 0;
|
53
|
+
right: 0;
|
54
|
+
bottom: 0;
|
55
|
+
|
56
|
+
background:
|
57
|
+
// Baseline (v-rhythm)
|
58
|
+
-webkit-linear-gradient(
|
59
|
+
transparent $grid-baseline,
|
60
|
+
rgba(white, $grid-guides-opacity) $grid-baseline),
|
61
|
+
// Columns
|
62
|
+
-webkit-linear-gradient(left,
|
63
|
+
rgba($grid-guides-color, $grid-guides-opacity),
|
64
|
+
rgba($grid-guides-color, $grid-guides-opacity) $-column-width,
|
65
|
+
transparent $-column-width,
|
66
|
+
transparent $column-gutter),
|
67
|
+
// Blocks
|
68
|
+
-webkit-linear-gradient(
|
69
|
+
transparent ($-block-height - $grid-baseline),
|
70
|
+
rgba(white, $grid-guides-opacity / 1.2) $grid-baseline),
|
71
|
+
// Base colour
|
72
|
+
-webkit-linear-gradient(
|
73
|
+
rgba($grid-guides-color, $grid-guides-opacity),
|
74
|
+
rgba($grid-guides-color, $grid-guides-opacity));
|
75
|
+
|
76
|
+
background-size:
|
77
|
+
$column-gutter $grid-baseline + 1, // v-rhythm
|
78
|
+
$-column-combined-width 10px, // column
|
79
|
+
$column-gutter ($-block-height + 1); // block
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
// Show grid guides on all grid containers
|
85
|
+
@mixin GRID-GUIDES($el: container, $position: back) {
|
86
|
+
%l-#{$el} {
|
87
|
+
@include show-grid-guides($position: $position);
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
|
92
|
+
// Show grid guide on element
|
93
|
+
@mixin show-grid-guides($position: back) {
|
94
|
+
@include grid-render-guides;
|
95
|
+
|
96
|
+
&::before {
|
97
|
+
&%l-row {
|
98
|
+
$-offset: grid-column-gutter()/2;
|
99
|
+
|
100
|
+
@if $grid-type == fluid {
|
101
|
+
$-offset: grid-percentage($-offset);
|
102
|
+
}
|
103
|
+
margin: 0 $-offset;
|
104
|
+
}
|
105
|
+
&%l-gutterless {
|
106
|
+
margin: 0;
|
107
|
+
}
|
108
|
+
|
109
|
+
// Grid placement (back by default)
|
110
|
+
@if $position == front {
|
111
|
+
z-index: 999;
|
112
|
+
} @else {
|
113
|
+
z-index: -1;
|
114
|
+
}
|
115
|
+
}
|
116
|
+
|
117
|
+
&%l-container %l-container::before {
|
118
|
+
content: none;
|
119
|
+
}
|
120
|
+
&%l-row %l-row::before {
|
121
|
+
content: none;
|
122
|
+
}
|
123
|
+
}
|