stratum 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/assets/stylesheets/_stratum.scss +26 -0
- data/assets/stylesheets/layout/_functions.scss +60 -0
- data/assets/stylesheets/layout/_grid.scss +228 -0
- data/assets/stylesheets/layout/_responsive.scss +50 -0
- data/assets/stylesheets/layout/grid-debug.scss +92 -0
- data/assets/stylesheets/layout/scaffolding.scss +114 -0
- data/assets/stylesheets/misc/_clearfix.scss +7 -0
- data/assets/stylesheets/misc/_forms.scss +12 -0
- data/bin/stratum +5 -0
- data/lib/stratum.rb +45 -0
- data/lib/version.rb +3 -0
- data/stratum.gemspec +13 -0
- metadata +59 -0
data/.gitignore
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
@charset "utf-8";
|
2
|
+
|
3
|
+
// © 2012 Tyom Semonov <mail@tyom.net>
|
4
|
+
// Inspired by Zurb's Foundation & Gridulator.
|
5
|
+
|
6
|
+
// -----------------------------------------------------------------------------
|
7
|
+
// Stratum settings
|
8
|
+
// -----------------------------------------------------------------------------
|
9
|
+
//
|
10
|
+
// Grid
|
11
|
+
//
|
12
|
+
// $grid-medium: 940px;
|
13
|
+
// $grid-large: 1200px;
|
14
|
+
// $grid-guides: true;
|
15
|
+
// $grid-guides-color: blue;
|
16
|
+
// $grid-guides-opacity: .1;
|
17
|
+
// $grid-guides-position: front;
|
18
|
+
$grid-total-columns: 12;
|
19
|
+
$grid-desired-gutter: 20px;
|
20
|
+
// $grid-baseline: 30px;
|
21
|
+
// $grid-type: flexible;
|
22
|
+
// -----------------------------------------------------------------------------
|
23
|
+
|
24
|
+
@import "layout/grid";
|
25
|
+
@import "layout/scaffolding";
|
26
|
+
// @import "layout/grid-debug";
|
@@ -0,0 +1,60 @@
|
|
1
|
+
// -----------------------------------------------------------------------------
|
2
|
+
// • Functions Tyom Semonov <mail@tyom.net>
|
3
|
+
// -----------------------------------------------------------------------------
|
4
|
+
// » grid-column-span-width($column-span, $column-width, $column-gutter)
|
5
|
+
// calculate merged columns with (including gutter)
|
6
|
+
// $column-span: <integer> - number of columns
|
7
|
+
// $column-width - with of single column
|
8
|
+
// $column-gutter - column gutter
|
9
|
+
//
|
10
|
+
// » grid-single-column-width($grid-width, $total-columns, $gutter)
|
11
|
+
// calculate single column width for given container width and gutter width
|
12
|
+
// $row-width - width of columns container
|
13
|
+
// $total-columns: <integer> - number of total columns
|
14
|
+
// $gutter - column gutter width
|
15
|
+
//
|
16
|
+
// » grid-column-gutter($grid-width, $desired)
|
17
|
+
// calculate gutter width from total grid width and desired approximate gutter width
|
18
|
+
// $grid-width - total grid width
|
19
|
+
// $grid-gutter - desired gutter width (will return closest)
|
20
|
+
//
|
21
|
+
// » number-to-word($number)
|
22
|
+
// return word for requested number
|
23
|
+
// $number <integer> - number to convert
|
24
|
+
// -----------------------------------------------------------------------------
|
25
|
+
|
26
|
+
// $column-span, $column-width, $column-gutter
|
27
|
+
// $container-margin is a multiplier. Set to 0 to exclude gutters from calculation
|
28
|
+
@function grid-column-span-width($column-span, $column-width, $column-gutter) {
|
29
|
+
@return ceil($column-span * $column-width + ($column-span - 1) * $column-gutter);
|
30
|
+
}
|
31
|
+
|
32
|
+
// $grid-width, $total-columns, $gutter
|
33
|
+
@function grid-single-column-width($grid-width, $total-columns, $gutter) {
|
34
|
+
@return ($grid-width - (($total-columns - 1) * $gutter)) / $total-columns;
|
35
|
+
}
|
36
|
+
|
37
|
+
// $grid-width, $desired
|
38
|
+
@function grid-column-gutter($grid-width, $desired) {
|
39
|
+
$gutter: 0px;
|
40
|
+
$column: 1;
|
41
|
+
// Find a round gutter width
|
42
|
+
@while $column > $gutter {
|
43
|
+
$column: grid-single-column-width($grid-width, $grid-total-columns, $gutter);
|
44
|
+
|
45
|
+
@if $column % 1 == 0 {
|
46
|
+
$range-from: $desired - 6;
|
47
|
+
$range-to: $desired + 20;
|
48
|
+
$within-range: $gutter >= $range-from and $gutter <= $range-to;
|
49
|
+
// Find gutter within desired range
|
50
|
+
@if $within-range {
|
51
|
+
@return $gutter;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
$gutter: $gutter + 1;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
@function grid-calculate-percentage($width, $grid-width: ($grid-medium + $grid-gutter-medium)) {
|
59
|
+
@return percentage($width / $grid-width);
|
60
|
+
}
|
@@ -0,0 +1,228 @@
|
|
1
|
+
// -----------------------------------------------------------------------------
|
2
|
+
// • Stratum Grid Mixins Tyom Semonov <mail@tyom.net>
|
3
|
+
// -----------------------------------------------------------------------------
|
4
|
+
// » grid-row($type: outer)
|
5
|
+
// Converts into grid row
|
6
|
+
// $type: outer - first outer containing row
|
7
|
+
// $type: inner - inner container rows
|
8
|
+
//
|
9
|
+
// » grid-column($variation: normal)
|
10
|
+
// Converts into grid column (generic for any size)
|
11
|
+
// $column: last - flushed right,
|
12
|
+
// $column: end - last but follows previous columns
|
13
|
+
// $column: inner - column in inner row
|
14
|
+
// $column: centered - centered column
|
15
|
+
//
|
16
|
+
// » grid-column-width($span: 1)
|
17
|
+
// Renders column width (specific size)
|
18
|
+
// » grid-offset-by-column($span: 1, $direction: left)
|
19
|
+
// Calculates column offset by $span columns
|
20
|
+
// $span: <integer> - span number of columns
|
21
|
+
// $direction: left - offset from left
|
22
|
+
// $direction: right - offset from right
|
23
|
+
//
|
24
|
+
// » grid-column-borders($color: rgba(black, .2))
|
25
|
+
// Renders borders on descendent columns
|
26
|
+
// $color: value - border color (#hex or Sass colour function)
|
27
|
+
//
|
28
|
+
// -----------------------------------------------------------------------------
|
29
|
+
|
30
|
+
@import "functions";
|
31
|
+
@import "responsive";
|
32
|
+
@import "../misc/clearfix";
|
33
|
+
|
34
|
+
// Grid defaults
|
35
|
+
// --------------
|
36
|
+
|
37
|
+
$grid-medium: 980px !default;
|
38
|
+
$grid-large: 1200px !default;
|
39
|
+
|
40
|
+
$grid-type: pixel !default;
|
41
|
+
$grid-total-columns: 12 !default;
|
42
|
+
$grid-baseline: 20px !default;
|
43
|
+
$grid-desired-gutter: 20px !default;
|
44
|
+
|
45
|
+
$grid-gutter-medium: grid-column-gutter($grid-medium, $grid-desired-gutter);
|
46
|
+
$grid-gutter-large: grid-column-gutter($grid-large, $grid-desired-gutter);
|
47
|
+
$grid-half-gutter-m: $grid-gutter-medium / 2;
|
48
|
+
$grid-half-gutter-l: $grid-gutter-large / 2;
|
49
|
+
$grid-column-medium: grid-single-column-width($grid-medium, $grid-total-columns, $grid-gutter-medium);
|
50
|
+
$grid-column-large: grid-single-column-width($grid-large, $grid-total-columns, $grid-gutter-large);
|
51
|
+
|
52
|
+
$grid-column: $grid-column-medium !default;
|
53
|
+
|
54
|
+
$grid-guides: false !default;
|
55
|
+
$grid-guides-color: #c84e5b !default;
|
56
|
+
$grid-guides-opacity: .2 !default;
|
57
|
+
$grid-guides-position: back !default;
|
58
|
+
|
59
|
+
// @debug "gutter medium:" $grid-gutter-large;
|
60
|
+
// @debug "column medium:" $grid-column-large;
|
61
|
+
|
62
|
+
// Mixins
|
63
|
+
// ------
|
64
|
+
|
65
|
+
// Grid container to set grid bounds
|
66
|
+
@mixin grid-container($width: $grid-medium) {
|
67
|
+
@include clearfix;
|
68
|
+
@if $grid-type != flexible {
|
69
|
+
width: $width;
|
70
|
+
min-width: $width;
|
71
|
+
max-width: 100%;
|
72
|
+
@include large-screen {
|
73
|
+
width: $grid-large;
|
74
|
+
}
|
75
|
+
}
|
76
|
+
margin: {
|
77
|
+
left: auto;
|
78
|
+
right: auto;
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
// Converts element into grid row
|
83
|
+
@mixin grid-row($variant: inner) {
|
84
|
+
@include clearfix;
|
85
|
+
@include grid-column-margins($variant, -1);
|
86
|
+
}
|
87
|
+
|
88
|
+
// Converts into grid column
|
89
|
+
// $variation - can be normal, last, end, inner or centered
|
90
|
+
@mixin grid-column($variation: normal) {
|
91
|
+
@if $variation == last {
|
92
|
+
float: right;
|
93
|
+
} @else if $variation == end {
|
94
|
+
float: left;
|
95
|
+
} @else if $variation == centered {
|
96
|
+
float: none;
|
97
|
+
} @else {
|
98
|
+
min-height: 1px;
|
99
|
+
float: left;
|
100
|
+
}
|
101
|
+
@include grid-column-margins($variation);
|
102
|
+
}
|
103
|
+
|
104
|
+
// Apply column margins
|
105
|
+
@mixin grid-column-margins($variation, $modifier: 1) {
|
106
|
+
@if $variation != collapse {
|
107
|
+
@if $variation == centered {
|
108
|
+
margin-left: auto;
|
109
|
+
margin-right: auto;
|
110
|
+
} @else if $variation == flexible {
|
111
|
+
margin-left: grid-calculate-percentage($grid-half-gutter-m * $modifier);
|
112
|
+
margin-right: grid-calculate-percentage($grid-half-gutter-m * $modifier);
|
113
|
+
} @else {
|
114
|
+
@if $variation == inner {
|
115
|
+
@if $grid-type == flexible {
|
116
|
+
margin-left: grid-calculate-percentage($grid-half-gutter-m * $modifier);
|
117
|
+
margin-right: grid-calculate-percentage($grid-half-gutter-m * $modifier);
|
118
|
+
} @else {
|
119
|
+
margin-left: $grid-half-gutter-m * $modifier;
|
120
|
+
margin-right: $grid-half-gutter-m * $modifier;
|
121
|
+
|
122
|
+
@include large-screen {
|
123
|
+
margin-left: $grid-half-gutter-l * $modifier;
|
124
|
+
margin-right: $grid-half-gutter-l * $modifier;
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
// Calculate single column width (in pixels) multipled by number of columns it spans (indluding gutters)
|
133
|
+
@mixin grid-column-width($span: 1) {
|
134
|
+
width: grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium);
|
135
|
+
@include large-screen {
|
136
|
+
width: grid-column-span-width($span, $grid-column-large, $grid-gutter-large);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
// Calculate single column width in percent
|
141
|
+
@mixin grid-column-width-flexi($span: 1, $collapse-margins: false) {
|
142
|
+
// Calculate width in percentages from the total grid width and gutter (based on medium),
|
143
|
+
// offset by provided gutter width
|
144
|
+
@if $collapse-margins {
|
145
|
+
width: grid-calculate-percentage(grid-column-span-width($span, $grid-column-medium + $grid-gutter-medium, 0));
|
146
|
+
} @else {
|
147
|
+
width: grid-calculate-percentage(grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium));
|
148
|
+
}
|
149
|
+
}
|
150
|
+
|
151
|
+
|
152
|
+
// Calculate offset width based on number of columns it spans (including gutters)
|
153
|
+
// $span <number>, $direction: <left/right>, $type <positive/negative>
|
154
|
+
@mixin grid-offset-by-column($span: 1, $direction: left, $type: positive, $first: false) {
|
155
|
+
$offset: 0;
|
156
|
+
|
157
|
+
@if $type == positive {
|
158
|
+
// normal offset
|
159
|
+
$offset: grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium) + ($grid-gutter-medium * 3 / 2);
|
160
|
+
} @else {
|
161
|
+
// negative offset
|
162
|
+
// left
|
163
|
+
@if $direction == left {
|
164
|
+
$offset: -(grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium) + ($grid-gutter-medium));
|
165
|
+
@if $first {
|
166
|
+
$offset: $offset + $grid-gutter-medium / 2;
|
167
|
+
}
|
168
|
+
// right
|
169
|
+
} @else {
|
170
|
+
$offset: -(grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium) + ($grid-gutter-medium / 2));
|
171
|
+
margin-left: abs($offset) + $grid-gutter-medium * 3 / 2;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
margin-#{$direction}: $offset;
|
175
|
+
|
176
|
+
@include large-screen {
|
177
|
+
@if $type == positive {
|
178
|
+
// normal offset
|
179
|
+
$offset: grid-column-span-width($span, $grid-column-large, $grid-gutter-large) + ($grid-gutter-large * 3 / 2);
|
180
|
+
} @else {
|
181
|
+
// negative offset
|
182
|
+
// left
|
183
|
+
@if $direction == left {
|
184
|
+
$offset: -(grid-column-span-width($span, $grid-column-large, $grid-gutter-large) + ($grid-gutter-large * $span));
|
185
|
+
@if $first {
|
186
|
+
$offset: $offset + $grid-gutter-large / 2;
|
187
|
+
}
|
188
|
+
// right
|
189
|
+
} @else {
|
190
|
+
$offset: -(grid-column-span-width($span, $grid-column-large, $grid-gutter-large) + ($grid-gutter-large / 2));
|
191
|
+
margin-left: abs($offset) + ($grid-gutter-large * 2) + ($grid-gutter-large / 2);
|
192
|
+
}
|
193
|
+
}
|
194
|
+
margin-#{$direction}: $offset;
|
195
|
+
}
|
196
|
+
|
197
|
+
@if $grid-type == flexible {
|
198
|
+
$offset: grid-calculate-percentage(grid-column-span-width($span, $grid-column-medium, $grid-gutter-medium) + ($grid-gutter-medium * 3 / 2));
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
|
203
|
+
// Renders borders between columns (except the first and the last ones)
|
204
|
+
// $grid-size, $color
|
205
|
+
@mixin grid-column-borders($column-gutter, $color: #ccc, $style: solid, $size: 1px) {
|
206
|
+
.col {
|
207
|
+
position: relative;
|
208
|
+
}
|
209
|
+
.col:before, .col:after {
|
210
|
+
content: "";
|
211
|
+
position: absolute;
|
212
|
+
width: 1px;
|
213
|
+
top: 0;
|
214
|
+
bottom: 0;
|
215
|
+
border: 0 $style $color;
|
216
|
+
}
|
217
|
+
.col:before {
|
218
|
+
border-left-width: $size;
|
219
|
+
left: -$column-gutter/2 - $size/2 - 1;
|
220
|
+
}
|
221
|
+
.col:after {
|
222
|
+
border-right-width: $size;
|
223
|
+
right: -$column-gutter/2 - $size/2 - 1;
|
224
|
+
}
|
225
|
+
.col:first-child:before, .col:last-child:after {
|
226
|
+
display: none;
|
227
|
+
}
|
228
|
+
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
@mixin smartphone {
|
2
|
+
@media only screen and (min-device-width : 320px) and (max-device-width : 480px) {
|
3
|
+
@content;
|
4
|
+
}
|
5
|
+
}
|
6
|
+
@mixin smartphone-landscape {
|
7
|
+
@media only screen and (min-width : 321px) {
|
8
|
+
@content;
|
9
|
+
}
|
10
|
+
}
|
11
|
+
@mixin smartphone-portrait {
|
12
|
+
@media only screen and (max-width : 320px) {
|
13
|
+
@content;
|
14
|
+
}
|
15
|
+
}
|
16
|
+
@mixin tablet {
|
17
|
+
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) {
|
18
|
+
@content;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
@mixin tablet-landscape {
|
22
|
+
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation: landscape) {
|
23
|
+
@content;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
@mixin tablet-portrait {
|
27
|
+
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation: portrait) {
|
28
|
+
@content;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
@mixin retina {
|
32
|
+
@media only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5) {
|
33
|
+
@content;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
@mixin medium-screen {
|
37
|
+
@media only screen and (min-width : 1024px) {
|
38
|
+
@content;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
@mixin large-screen {
|
42
|
+
@media only screen and (min-width : 1300px) {
|
43
|
+
@content;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
@mixin x-large-screen {
|
47
|
+
@media only screen and (min-width : 1824px) {
|
48
|
+
@content;
|
49
|
+
}
|
50
|
+
}
|
@@ -0,0 +1,92 @@
|
|
1
|
+
// -----------------------------------------------------------------------------
|
2
|
+
// • Pixel Grid Guides Mixins (Tyom Semonov <mail@tyom.net>)
|
3
|
+
// -----------------------------------------------------------------------------
|
4
|
+
// » grid-show-guides($col-width: $grid-column, $block-size: 9, $color: $grid-guides-color, $opacity: .8, $position: $grid-guides-position)
|
5
|
+
// Renders grid guides
|
6
|
+
// $column-width - width of columns
|
7
|
+
// $block-size - height of module blocks
|
8
|
+
// $color - grid colour (#hex or Sass colour function)
|
9
|
+
// $opacity - grid opacity
|
10
|
+
// $position:back - place grid behind page elements
|
11
|
+
// $position:front - place grid in front of page elements
|
12
|
+
// -----------------------------------------------------------------------------
|
13
|
+
|
14
|
+
// Draws grid guides
|
15
|
+
// $grid-size, $block-size,$color, $opacity, $position
|
16
|
+
@mixin grid-show-guides($grid-size: $grid-medium, $block-size: 9, $color: $grid-guides-color, $opacity: $grid-guides-opacity, $position: $grid-guides-position, $grid-type: pixel) {
|
17
|
+
|
18
|
+
$column-gutter: grid-column-gutter($grid-size, $grid-desired-gutter);
|
19
|
+
$column-width: grid-single-column-width($grid-size, $grid-total-columns, $column-gutter);
|
20
|
+
|
21
|
+
@if $grid-type == flexible {
|
22
|
+
$column-gutter: grid-calculate-percentage($column-gutter);
|
23
|
+
$column-width: grid-calculate-percentage($column-width);
|
24
|
+
}
|
25
|
+
|
26
|
+
$combined-width: $column-width + $column-gutter;
|
27
|
+
$block-height: (($grid-baseline + 1) * $block-size) + $grid-baseline;
|
28
|
+
|
29
|
+
position: relative;
|
30
|
+
|
31
|
+
&:before {
|
32
|
+
content: "";
|
33
|
+
position: absolute;
|
34
|
+
width: 100%;
|
35
|
+
height: 100%;
|
36
|
+
|
37
|
+
@include background(
|
38
|
+
// Baseline (v-rhythm)
|
39
|
+
linear-gradient(transparent $grid-baseline, rgba(white, $opacity) $grid-baseline),
|
40
|
+
// Columns
|
41
|
+
linear-gradient(left, rgba($color, $opacity),
|
42
|
+
rgba($color, $opacity) $column-width,
|
43
|
+
transparent $column-width,
|
44
|
+
transparent $combined-width
|
45
|
+
),
|
46
|
+
// Blocks
|
47
|
+
linear-gradient(transparent ($block-height - $grid-baseline), rgba(white, $opacity / 1.2) $grid-baseline),
|
48
|
+
// Base colour
|
49
|
+
linear-gradient(rgba($color, $opacity), rgba($color, $opacity))
|
50
|
+
);
|
51
|
+
background-size: $combined-width $grid-baseline + 1, // v-rhythm
|
52
|
+
$combined-width 10px, // column
|
53
|
+
$combined-width ($block-height + 1); // block
|
54
|
+
|
55
|
+
@if $grid-type == flexible {
|
56
|
+
// Offset column by half gutter
|
57
|
+
background-position: 0 0, -($column-gutter/4) 0, 0 0;
|
58
|
+
}
|
59
|
+
|
60
|
+
// Grid placement (back by default)
|
61
|
+
@if $position == front {
|
62
|
+
z-index: 999;
|
63
|
+
} @else {
|
64
|
+
z-index: -1;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
}
|
68
|
+
|
69
|
+
// Grid debugging
|
70
|
+
.show-grid {
|
71
|
+
@include grid-show-guides($grid-medium);
|
72
|
+
|
73
|
+
@include large-screen {
|
74
|
+
@include grid-show-guides($grid-large);
|
75
|
+
}
|
76
|
+
&.flexible {
|
77
|
+
@include grid-show-guides($grid-type: flexible);
|
78
|
+
}
|
79
|
+
&.front:before {
|
80
|
+
z-index: auto;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
// Show grid on .container if enabled
|
85
|
+
@if $grid-guides {
|
86
|
+
.container {
|
87
|
+
@extend .show-grid;
|
88
|
+
.row:before {
|
89
|
+
display: none;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
@@ -0,0 +1,114 @@
|
|
1
|
+
@import "grid";
|
2
|
+
|
3
|
+
// = Rows
|
4
|
+
.l-container {
|
5
|
+
@include grid-container;
|
6
|
+
.l-row {
|
7
|
+
@include grid-row;
|
8
|
+
}
|
9
|
+
// Flexible rows
|
10
|
+
.m-flexible, .m-flexible .l-row {
|
11
|
+
min-width: 0;
|
12
|
+
@include grid-row(flexible);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
|
17
|
+
// = Columns
|
18
|
+
.l-col {
|
19
|
+
@include grid-column;
|
20
|
+
}
|
21
|
+
// Centred column
|
22
|
+
.l-col.m-centered, .l-col.centered:last-child {
|
23
|
+
@include grid-column(centered);
|
24
|
+
}
|
25
|
+
// Last column
|
26
|
+
.l-col + .l-col:last-child, .l-col.m-last {
|
27
|
+
@include grid-column(last);
|
28
|
+
}
|
29
|
+
// Ending column (follows others)
|
30
|
+
.l-col + .l-col.m-end {
|
31
|
+
@include grid-column(end);
|
32
|
+
}
|
33
|
+
// Columns in the inner row
|
34
|
+
.l-row .m-col {
|
35
|
+
@include grid-column-margins(inner);
|
36
|
+
}
|
37
|
+
// Flexible columns
|
38
|
+
.m-flexible .l-col {
|
39
|
+
@include grid-column-margins(flexible);
|
40
|
+
}
|
41
|
+
// Flexible columns with no margins
|
42
|
+
.m-collapse .l-col, .l-container > .l-col {
|
43
|
+
@include grid-column-margins(flexible, 0);
|
44
|
+
}
|
45
|
+
|
46
|
+
|
47
|
+
// = Column sizes
|
48
|
+
@for $i from 1 through $grid-total-columns {
|
49
|
+
.m-#{$i} {
|
50
|
+
@if $grid-type == pixel {
|
51
|
+
@include grid-column-width($i);
|
52
|
+
} @else {
|
53
|
+
@include grid-column-width-flexi($i);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
// Ad hoc flexible grid
|
57
|
+
.l-flexible .m-#{$i} {
|
58
|
+
@include grid-column-width-flexi($i, false);
|
59
|
+
}
|
60
|
+
.m-flexible.m-collapse .m-#{$i},
|
61
|
+
.l-container > .m-#{$i} {
|
62
|
+
@include grid-column-width-flexi($i, true);
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
// = Offsets:
|
68
|
+
@for $i from 1 through $grid-total-columns {
|
69
|
+
// From left
|
70
|
+
.l-row .l-col.m-#{$i}-from-left,
|
71
|
+
.l-row .l-col.m-#{$i}-from-left.m-end {
|
72
|
+
@include grid-offset-by-column($i, left);
|
73
|
+
}
|
74
|
+
// To left
|
75
|
+
.l-row .l-col.m-#{$i}-to-left,
|
76
|
+
.l-row .l-col.m-#{$i}-to-left.m-end {
|
77
|
+
@include grid-offset-by-column($i, left, negative);
|
78
|
+
&:first-child {
|
79
|
+
@include grid-offset-by-column($i, left, negative, $first: true);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
// From right
|
83
|
+
.l-row .l-col.m-#{$i}-from-right,
|
84
|
+
.l-row .l-col.m-#{$i}-from-right.m-end,
|
85
|
+
.l-row .l-col.m-#{$i}-from-right.m-last {
|
86
|
+
@include grid-offset-by-column($i, right);
|
87
|
+
}
|
88
|
+
// To right
|
89
|
+
.l-row .l-col.m-#{$i}-to-right,
|
90
|
+
.l-row .l-col.m-#{$i}-to-right.m-end {
|
91
|
+
@include grid-offset-by-column($i, right, negative);
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
|
96
|
+
// Borders
|
97
|
+
.m-column-borders {
|
98
|
+
@include grid-column-borders($grid-gutter-medium);
|
99
|
+
|
100
|
+
@include large-screen {
|
101
|
+
@include grid-column-borders($grid-gutter-large);
|
102
|
+
}
|
103
|
+
// Remove borders within row with borders
|
104
|
+
.m-no-borders {
|
105
|
+
margin: {
|
106
|
+
left: 0;
|
107
|
+
right: 0;
|
108
|
+
};
|
109
|
+
:before, :after {
|
110
|
+
border: 0;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
data/bin/stratum
ADDED
data/lib/stratum.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative 'version.rb'
|
2
|
+
require 'pathname'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'thor'
|
5
|
+
require 'pry'
|
6
|
+
|
7
|
+
module Stratum
|
8
|
+
class Generator < Thor
|
9
|
+
map ['-v', '--version'] => :version
|
10
|
+
|
11
|
+
desc 'install', 'Install Stratum into current directory'
|
12
|
+
method_options :path => :string
|
13
|
+
def install
|
14
|
+
copy_files
|
15
|
+
puts "Stratum installed to #{install_path}"
|
16
|
+
end
|
17
|
+
|
18
|
+
desc 'version', 'Show Stratum version'
|
19
|
+
def version
|
20
|
+
say "Stratum #{Stratum::VERSION}"
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def install_path
|
26
|
+
@install_path ||= if options[:path]
|
27
|
+
Pathname.new(File.join(options[:path], 'stratum'))
|
28
|
+
else
|
29
|
+
Pathname.new('stratum')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def copy_files
|
34
|
+
FileUtils.mkdir_p(install_path)
|
35
|
+
FileUtils.cp_r(stratum_stylesheets, install_path)
|
36
|
+
end
|
37
|
+
|
38
|
+
def stratum_stylesheets
|
39
|
+
current_dir = File.dirname(File.dirname(__FILE__))
|
40
|
+
stylesheets = File.join(current_dir, "assets", "stylesheets")
|
41
|
+
|
42
|
+
Dir["#{stylesheets}/*"]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/lib/version.rb
ADDED
data/stratum.gemspec
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'stratum'
|
3
|
+
s.version = '0.1.1'
|
4
|
+
s.date = '2013-01-19'
|
5
|
+
s.summary = "A structural layer for your SASS"
|
6
|
+
s.description = "Stratum is a collection of SASS mixins and utilities for your web development needs."
|
7
|
+
s.authors = ["Tyom Semonov"]
|
8
|
+
s.email = 'tyom@semonov.com'
|
9
|
+
s.files = `git ls-files | grep -v demo`.split("\n")
|
10
|
+
s.executables << 'stratum'
|
11
|
+
s.homepage =
|
12
|
+
'http://rubygems.org/gems/stratum'
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stratum
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Tyom Semonov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-19 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: Stratum is a collection of SASS mixins and utilities for your web development
|
15
|
+
needs.
|
16
|
+
email: tyom@semonov.com
|
17
|
+
executables:
|
18
|
+
- stratum
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- assets/stylesheets/_stratum.scss
|
24
|
+
- assets/stylesheets/layout/_functions.scss
|
25
|
+
- assets/stylesheets/layout/_grid.scss
|
26
|
+
- assets/stylesheets/layout/_responsive.scss
|
27
|
+
- assets/stylesheets/layout/grid-debug.scss
|
28
|
+
- assets/stylesheets/layout/scaffolding.scss
|
29
|
+
- assets/stylesheets/misc/_clearfix.scss
|
30
|
+
- assets/stylesheets/misc/_forms.scss
|
31
|
+
- bin/stratum
|
32
|
+
- lib/stratum.rb
|
33
|
+
- lib/version.rb
|
34
|
+
- stratum.gemspec
|
35
|
+
homepage: http://rubygems.org/gems/stratum
|
36
|
+
licenses: []
|
37
|
+
post_install_message:
|
38
|
+
rdoc_options: []
|
39
|
+
require_paths:
|
40
|
+
- lib
|
41
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
|
+
none: false
|
49
|
+
requirements:
|
50
|
+
- - ! '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 1.8.15
|
56
|
+
signing_key:
|
57
|
+
specification_version: 3
|
58
|
+
summary: A structural layer for your SASS
|
59
|
+
test_files: []
|