stratum 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  *gem
2
2
  *swp
3
3
  .sass-cache
4
- demo/_site/
5
4
  vendor/
5
+ css/
6
+ _site/
6
7
  stratum/
data/.gitmodules CHANGED
@@ -1,7 +1,3 @@
1
- [submodule "demo/vendor/livereload-js"]
2
- path = demo/vendor/livereload-js
1
+ [submodule "tests/vendor/livereload-js"]
2
+ path = tests/vendor/livereload-js
3
3
  url = git@github.com:tyom/livereload-js.git
4
- dirty = ignore
5
- [submodule "tests"]
6
- path = tests
7
- url = https://github.com/tyom/stratum
@@ -32,38 +32,28 @@
32
32
  @function grid-column-width($grid-size: $grid-size, $total-columns: $grid-total-columns, $gutter: auto) {
33
33
  @if $gutter == auto {
34
34
  $gutter: grid-column-gutter($grid-size, $grid-desired-gutter);
35
+ } @else {
36
+ $gutter: $gutter;
35
37
  }
36
38
  @return ($grid-size - (($total-columns - 1) * $gutter)) / $total-columns;
37
39
  }
38
40
 
39
41
  // # Calculate the total width of number of columns including gutters
40
42
  // `$column-width` & `$gutter` are optional (use grid defaults)
41
- @function grid-columns-width($column-span, $column-width: auto, $gutter: auto, $type: $grid-type, $has-row: true) {
42
- @if $column-width == auto {
43
- $column-width: grid-column-width();
44
- }
45
- @if $gutter == auto {
46
- $gutter: grid-column-gutter($grid-size, $grid-desired-gutter);
47
- } @else if $gutter == 0 {
48
- // Adjust gutter width to exclude two half gutters on each side of grid container
49
- // TODO simplify this bit and make it more obvious what's going on here (why pixel and fluid affect gutterless column behaviour)
50
- // 1 is required to remove 1 gutter width from total width due to "rowed" columns adding extra gutter width
51
- // FIXME This modifiers logic should be reviewed soon. Need to extract the ratios somewhere globally and apply them
52
- // where they are needed (e.g. grid guides)
53
- // It only affects m-pixel/m-fluid container modifiers of "rowless" grids
54
- // e.g. .m-gutterless.m-pixel (on global fluid grid)
55
- $v-mod: if($grid-type == pixel, 0, 1);
56
- @if $has-row {
57
- $v-mod: if($grid-type == pixel, 1, 0);
58
- }
59
- $v-gutter-width-adjusted: ($grid-gutter * ($grid-total-columns - $v-mod)) / $grid-total-columns;
60
- $column-width: $column-width + $v-gutter-width-adjusted;
43
+ @function grid-columns-width($column-span, $column-width: auto, $gutter: auto, $type: $grid-type, $total-columns: $grid-total-columns) {
44
+ $v-gutter: grid-column-gutter($grid-size, $grid-desired-gutter);
45
+
46
+ @if $gutter == 0 {
47
+ $v-gutter: 0;
48
+ $column-width: grid-column-width($total-columns: $total-columns, $gutter: 0) * $column-span;
49
+ } @else {
50
+ $column-width: ceil($column-span * grid-column-width($total-columns: $total-columns) + (($column-span - 1) * $v-gutter));
61
51
  }
62
52
 
63
- $column-width: ceil($column-span * $column-width + ($column-span - 1) * $gutter);
53
+ $v-grid-size: $grid-size + $v-gutter;
64
54
 
65
55
  @if $type == fluid {
66
- $column-width: grid-percentage($column-width);
56
+ $column-width: grid-percentage($column-width, $v-grid-size);
67
57
  }
68
58
 
69
59
  @return $column-width;
@@ -12,7 +12,8 @@ $grid-column: grid-column-width();
12
12
 
13
13
  // Grid container to set grid bounds
14
14
  @mixin grid-container($width: $grid-size) {
15
- min-width: $width;
15
+ @include box-sizing(content-box);
16
+ @include group;
16
17
  max-width: 100%;
17
18
  width: $width;
18
19
  margin: {
@@ -24,7 +25,9 @@ $grid-column: grid-column-width();
24
25
  // Grid row
25
26
  // $type: <pixel|fluid>
26
27
  @mixin grid-row($type: $grid-type) {
28
+ @include group;
27
29
  @include grid-column-margins($type, -1);
30
+ clear: both;
28
31
  }
29
32
 
30
33
  // Converts into grid column
@@ -54,11 +57,10 @@ $grid-column: grid-column-width();
54
57
  }
55
58
 
56
59
  // Calculate single column width (in pixels) multipled by number of columns it spans (indluding gutters)
57
- @mixin grid-column-width($span: 1, $type: $grid-type, $gutter: $grid-gutter, $has-row: true) {
58
- width: grid-columns-width($span, $grid-column, $gutter, $type, $has-row);
60
+ @mixin grid-column-width($span: 1, $type: $grid-type, $gutter: $grid-gutter, $total-columns: $grid-total-columns) {
61
+ width: grid-columns-width($span, $grid-column, $gutter, $type, $total-columns);
59
62
  }
60
63
 
61
-
62
64
  // Calculate offset width based on number of columns it spans (including gutters)
63
65
  @mixin grid-offset-by-column($span: 1, $direction: left, $flow: positive, $grid-type: $grid-type) {
64
66
  $v-offset: grid-columns-width($span, $type: $grid-type);
@@ -71,7 +73,6 @@ $grid-column: grid-column-width();
71
73
 
72
74
  // Negative offset
73
75
  @if $flow == negative {
74
- // @debug $v-offset, $v-gutter, $v-gutter / 2;
75
76
  margin-#{$direction}: -$v-offset - ($v-gutter / 2);
76
77
  } @else {
77
78
  margin-#{$direction}: $v-offset + ($v-gutter * 1.5);
@@ -1,11 +1,15 @@
1
1
  // Semantic grid components
2
2
  // ========================
3
3
 
4
- // These class placeholders can be used to convert any element into
4
+ // These placeholder selectors can be used to convert any element into
5
5
  // grid component. To use extend element with appropriate placeholder.
6
6
  // It will automatically take care of the parent and descending components
7
7
  // as long as the correct grid components are used.
8
8
 
9
+ // You should think about this file as mapping between your styles and
10
+ // grid mixins and functions that calculate your individual grid elements
11
+ // from parameters you provide. It doesn't contain any values.
12
+
9
13
  // The structure of the grid is as follows:
10
14
 
11
15
  // %l-container – A grid is always contained in one of these
@@ -20,11 +24,7 @@
20
24
  //
21
25
  // %l-col – Column, the unit of the grid
22
26
  // %l-col-<$i> – Column size (e.g. `%l-col-4` spans four single columns, including three gutters)
23
- // %l-col-full – 100% width
24
- // %l-col-half – 50% width
25
- // %l-col-quarter – 25% width
26
- // %l-col-eighth – 12.5% width
27
- // %l-col-sixteenth – 6.25% width
27
+ // %l-col-<n>-of-<n> - Fractional column size of parent total (e.g. 2-of-8 is 2/8 and equals 25%)
28
28
  // %l-col-center - Center column
29
29
  //
30
30
  // l-col-from-left-<$i> – Offset column by <column size> from left
@@ -45,19 +45,15 @@
45
45
  // Grid container
46
46
  %l-container {
47
47
  @include grid-container;
48
- @include box-sizing(content-box);
49
- @include group;
50
48
 
51
49
  // Defines inner grid container (nested grid)
52
50
  %l-container {
53
- min-width: 0;
54
- width: 100%;
51
+ width: auto;
55
52
  }
56
53
 
57
54
  // Defines grid row
58
55
  %l-row {
59
56
  @include grid-row;
60
- @include group;
61
57
  }
62
58
 
63
59
  // Defines grid row of forced fluid grid
@@ -96,6 +92,7 @@
96
92
  }
97
93
  }
98
94
 
95
+
99
96
  // Float last column to right if `%l-last-col-right` extended
100
97
  // Applied to `%l-container`
101
98
  %l-col + %l-col:last-child {
@@ -122,53 +119,34 @@
122
119
  @include grid-column-margins(fluid);
123
120
  }
124
121
 
125
- // Forced grid type and gutterless
126
- %l-grid-pixel %l-gutterless & {
127
- @include grid-column-width($i, pixel, 0);
128
- }
129
- %l-grid-fluid %l-gutterless & {
130
- @include grid-column-width($i, fluid, 0, false);
131
- }
132
-
133
122
  // Force gutterless grid
134
123
  %l-gutterless &,
135
124
  // Apply gutterless grid on columns without rows
136
125
  %l-container > & {
137
- @include grid-column-width($i, $grid-type, 0);
126
+ @include grid-column-width($i, $grid-type, $gutter: 0);
138
127
  @include grid-column-margins(0);
139
128
  }
140
129
 
141
- // Force gutterless when row is absent
142
- %l-grid-pixel > & {
143
- @include grid-column-width($i, pixel, 0, false);
130
+ %l-grid-pixel > &,
131
+ %l-grid-pixel %l-gutterless & {
132
+ @include grid-column-width($i, pixel, $gutter: 0);
144
133
  @include grid-column-margins(0);
145
134
  }
146
- %l-grid-fluid > & {
147
- @include grid-column-width($i, fluid, 0, false);
135
+ %l-grid-fluid > &,
136
+ %l-grid-fluid %l-gutterless & {
137
+ @include grid-column-width($i, fluid, $gutter: 0);
148
138
  @include grid-column-margins(0);
149
139
  }
150
140
  }
151
141
  }
152
142
 
153
-
154
- // Fluid grid subdivisions
155
- %l-col-full {
156
- width: 100%;
157
- }
158
- %l-col-half {
159
- width: 50%;
160
- }
161
- %l-col-third {
162
- width: 33.33333%;
163
- }
164
- %l-col-quarter {
165
- width: 25%;
166
- }
167
- %l-col-eighth {
168
- width: 12.5%;
169
- }
170
- %l-col-sixteenth {
171
- width: 6.25%;
143
+ // Column spans for custom grids
144
+ @for $i from 1 through $grid-total-columns {
145
+ @for $n from 1 through $grid-total-columns {
146
+ %l-col-#{$i}-of-#{$n} {
147
+ @include grid-column-width($i, fluid, $gutter: 0, $total-columns: $n);
148
+ }
149
+ }
172
150
  }
173
151
 
174
152
 
@@ -196,7 +174,6 @@
196
174
  // Column offsets
197
175
  %l-container {
198
176
  @for $i from 1 through $grid-total-columns {
199
-
200
177
  // ## Grid with margins
201
178
  // Default grid offsets
202
179
  & > %l-row %l-col {
@@ -61,16 +61,23 @@
61
61
  }
62
62
  }
63
63
 
64
- // Generic column modifiers
65
- .l-col {
66
- // Centre column
67
- &.m-centered {
68
- @extend %l-col-center;
69
- }
70
- // Grid column subdivisions
71
- @each $word in full, half, quarter, eighth, sixteenth {
72
- &.m-#{$word} {
73
- @extend %l-col-#{$word};
64
+ // fractional column modifiers
65
+ @for $total from 1 through $grid-total-columns {
66
+ .l-col {
67
+ &.m-1-of-#{$total} {
68
+ @extend %l-col-1-of-#{$total};
69
+ }
70
+ @for $col from 1 through $total {
71
+ &.m-#{$col}-of-#{$total} {
72
+ @if $total > $col {
73
+ @extend %l-col-#{$col}-of-#{$total};
74
+ }
75
+ }
74
76
  }
75
77
  }
76
78
  }
79
+
80
+ // Centre column
81
+ .l-col.m-centered {
82
+ @extend %l-col-center;
83
+ }
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Stratum
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
data/tests/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rb-fsevent', '~> 0.9.1'
4
+ gem 'guard-sass', :require => false
5
+ gem 'guard-livereload'
6
+ gem 'jekyll'
@@ -0,0 +1,63 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ addressable (2.3.2)
5
+ classifier (1.3.3)
6
+ fast-stemmer (>= 1.0.0)
7
+ coderay (1.0.8)
8
+ directory_watcher (1.4.1)
9
+ em-websocket (0.3.8)
10
+ addressable (>= 2.1.1)
11
+ eventmachine (>= 0.12.9)
12
+ eventmachine (1.0.0)
13
+ fast-stemmer (1.0.1)
14
+ guard (1.6.1)
15
+ listen (>= 0.6.0)
16
+ lumberjack (>= 1.0.2)
17
+ pry (>= 0.9.10)
18
+ thor (>= 0.14.6)
19
+ guard-livereload (1.1.3)
20
+ em-websocket (>= 0.2.0)
21
+ guard (>= 1.5.0)
22
+ multi_json (~> 1.0)
23
+ guard-sass (1.0.1)
24
+ guard (>= 1.1.0)
25
+ sass (>= 3.1)
26
+ jekyll (0.12.0)
27
+ classifier (~> 1.3)
28
+ directory_watcher (~> 1.1)
29
+ kramdown (~> 0.13.4)
30
+ liquid (~> 2.3)
31
+ maruku (~> 0.5)
32
+ pygments.rb (~> 0.3.2)
33
+ kramdown (0.13.8)
34
+ liquid (2.4.1)
35
+ listen (0.7.2)
36
+ lumberjack (1.0.2)
37
+ maruku (0.6.1)
38
+ syntax (>= 1.0.0)
39
+ method_source (0.8.1)
40
+ multi_json (1.5.0)
41
+ posix-spawn (0.3.6)
42
+ pry (0.9.11.4)
43
+ coderay (~> 1.0.5)
44
+ method_source (~> 0.8)
45
+ slop (~> 3.4)
46
+ pygments.rb (0.3.7)
47
+ posix-spawn (~> 0.3.6)
48
+ yajl-ruby (~> 1.1.0)
49
+ rb-fsevent (0.9.3)
50
+ sass (3.2.5)
51
+ slop (3.4.3)
52
+ syntax (1.0.0)
53
+ thor (0.16.0)
54
+ yajl-ruby (1.1.0)
55
+
56
+ PLATFORMS
57
+ ruby
58
+
59
+ DEPENDENCIES
60
+ guard-livereload
61
+ guard-sass
62
+ jekyll
63
+ rb-fsevent (~> 0.9.1)
data/tests/Guardfile ADDED
@@ -0,0 +1,11 @@
1
+ guard 'sass',
2
+ :load_paths => ['../assets/stylesheets'],
3
+ # :debug_info => true,
4
+ :input => 'scss',
5
+ :output => 'css'
6
+
7
+ guard 'livereload' do
8
+ # watch(%r{../assets/stylesheets/.+\.(scss)})
9
+ watch(%r{grid/.+\.(html)})
10
+ watch(%r{scss/.+\.(scss)})
11
+ end
data/tests/_config.yml ADDED
@@ -0,0 +1,5 @@
1
+ server: true
2
+ auto: true
3
+ baseurl: /stratum
4
+ exclude: Gemfile, Gemfile.lock, Guardfile, node_modules, test, scss
5
+ include: css
@@ -0,0 +1,8 @@
1
+ <header id="masthead">
2
+ <ul class="nav">
3
+ <li {% if page.id == "pixel" %} class="active"{% endif %}><a href="{{site.baseurl}}/grid/pixel.html">Pixel Grid</a></li>
4
+ <li {% if page.id == "fluid" %} class="active"{% endif %}><a href="{{site.baseurl}}/grid/fluid.html">Fluid Grid</a></li>
5
+ <li {% if page.id == "bbc" %} class="active"{% endif %}><a href="{{site.baseurl}}/grid/bbc.html">BBC Homepage Example</a></li>
6
+ <li {% if page.id == "arstechnica" %} class="active"{% endif %}><a href="{{site.baseurl}}/grid/arstechnica.html">Arstechnica Layout Example</a></li>
7
+ </ul>
8
+ </header>
@@ -0,0 +1,58 @@
1
+ <h2>Normal</h2>
2
+ <div class="l-row">
3
+ <div class="l-col m-3">
4
+ <span>.l-col.m-3</span>
5
+ </div>
6
+ <div class="l-col m-3">
7
+ <span>.l-col.m-3</span>
8
+ </div>
9
+ <div class="l-col m-3">
10
+ <span>.l-col.m-3</span>
11
+ </div>
12
+ <div class="l-col m-3">
13
+ <span>.l-col.m-3</span>
14
+ </div>
15
+ </div>
16
+
17
+ <h2>Offsets</h2>
18
+ <div class="l-row">
19
+ <div class="l-col m-4 m-to-left-1 m-from-right-1">
20
+ <span>.l-col.m-to-left-1.m-from-right-1</span>
21
+ </div>
22
+ <div class="l-col m-4">
23
+ <span>.l-col.m-4</span>
24
+ </div>
25
+ <div class="l-col m-4 m-to-right-1 m-from-left-1">
26
+ <span>.l-col.m-to-right-1.m-from-left-1</span>
27
+ </div>
28
+ </div>
29
+
30
+ <header>
31
+ <h2>No column gutters</h2>
32
+ <code>.l-row.m-gutterless</code>
33
+ </header>
34
+ <div class="l-row m-gutterless">
35
+ <div class="l-col m-6">
36
+ <span>.l-col.m-6</span>
37
+ </div>
38
+ <div class="l-col m-3">
39
+ <span>.l-col.m-3</span>
40
+ </div>
41
+ <div class="l-col m-3">
42
+ <span>.l-col.m-3</span>
43
+ </div>
44
+ </div>
45
+
46
+ <header>
47
+ <h2>No row</h2>
48
+ identical to <code>.l-row.m-gutterless</code>
49
+ </header>
50
+ <div class="l-col m-6">
51
+ <span>.l-col.m-6</span>
52
+ </div>
53
+ <div class="l-col m-3">
54
+ <span>.l-col.m-3</span>
55
+ </div>
56
+ <div class="l-col m-3">
57
+ <span>.l-col.m-3</span>
58
+ </div>
@@ -0,0 +1,21 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
6
+ <title>{{ page.title }}</title>
7
+ <meta name="viewport" content="width=device-width">
8
+ <link rel="stylesheet" href="{{site.baseurl}}/css/main.css">
9
+ {% for stylesheet in page.css %}
10
+ <link rel="stylesheet" href="{{site.baseurl}}/css/{{ stylesheet }}.css">
11
+ {% endfor %}
12
+ <script src="{{site.baseurl}}/vendor/livereload-js/dist/livereload.js?host=localhost"></script>
13
+ </head>
14
+ <body>
15
+ {% if page.menu == 'grids' %}
16
+ {% include menu-grids.html %}
17
+ {% endif %}
18
+
19
+ {{ content }}
20
+ </body>
21
+ </html>
@@ -0,0 +1,56 @@
1
+ ---
2
+ layout: default
3
+ title: Arstechnica Layout Demo
4
+ id: arstechnica
5
+ css: arstechnica
6
+ menu: grids
7
+ ---
8
+
9
+ <div class="reference">
10
+ <img src="{{site.baseurl}}/images/arstechnica.png" alt="">
11
+ </div>
12
+
13
+ <div id="page" class="l-container">
14
+ <div class="masthead"></div>
15
+ <nav></nav>
16
+ <div class="content l-container m-fluid">
17
+ <div class="head"></div>
18
+ <div class="l-row">
19
+ <div class="content l-col">
20
+ <div class="l-container">
21
+ <div class="p-title"></div>
22
+ <div class="p-meta"></div>
23
+ <div class="p-image"></div>
24
+ <div class="p-text"></div>
25
+
26
+ <div class="related l-row">
27
+ <div class="p-title l-col m-1-of-1"></div>
28
+ <div class="l-col m-1-of-4"></div>
29
+ <div class="l-col m-1-of-4"></div>
30
+ <div class="l-col m-1-of-4"></div>
31
+ <div class="l-col m-1-of-4"></div>
32
+ <div class="l-col m-1-of-4"></div>
33
+ <div class="l-col m-1-of-4"></div>
34
+ <div class="l-col m-1-of-4"></div>
35
+ <div class="l-col m-1-of-4"></div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ <aside class="sidebar l-col"></aside>
40
+ </div>
41
+ </div>
42
+ <footer class="mastfoot l-row m-gutterless">
43
+ <div class="l-col m-2">
44
+ <span>2 columns</span>
45
+ </div>
46
+ <div class="l-col m-2">
47
+ <span>2 columns</span>
48
+ </div>
49
+ <div class="l-col m-2">
50
+ <span>2 columns</span>
51
+ </div>
52
+ <div class="l-col m-2">
53
+ <span>2 columns</span>
54
+ </div>
55
+ </footer>
56
+ </div>
@@ -0,0 +1,74 @@
1
+ ---
2
+ layout: default
3
+ title: BBC Layout Demo
4
+ id: bbc
5
+ css: bbc
6
+ menu: grids
7
+ ---
8
+
9
+ <div class="reference">
10
+ <img src="{{site.baseurl}}/images/bbc.png" alt="">
11
+ </div>
12
+
13
+ <div id="page">
14
+ <div class="top-banner"></div>
15
+
16
+ <div class="nav">
17
+ <div class="l-container">
18
+ <div class="l-row">
19
+ <div class="l-col m-8">
20
+ <span>8 columns</span>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="hero l-container">
27
+ <div class="head l-row">
28
+ <div class="p-title l-col m-4">
29
+ <span>4 columns</span>
30
+ </div>
31
+ <div class="p-weather l-col m-4">
32
+ <span>4 columns</span>
33
+ </div>
34
+ </div>
35
+ <div class="dashboard l-row m-gutterless">
36
+ <div class="l-col m-left m-4">
37
+ <div class="p-item l-col m-1-of-1">
38
+ <span>4 columns</span>
39
+ </div>
40
+ <div class="p-item l-col m-1-of-2">
41
+ <span>2 columns</span>
42
+ </div>
43
+ <div class="p-item l-col m-1-of-2">
44
+ <span>2 columns</span>
45
+ </div>
46
+ </div>
47
+ <div class="l-col m-right m-4">
48
+ <div class="p-item l-col m-1-of-2">
49
+ <span>2 columns</span>
50
+ </div>
51
+ <div class="p-item l-col m-1-of-2">
52
+ <span>2 columns</span>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ <nav class="l-col m-7 m-centered">
57
+ <span>7 columns</span>
58
+ </nav>
59
+ </div>
60
+
61
+ <div class="content l-container">
62
+ <div class="l-col m-3">
63
+ <span>3 columns</span>
64
+ </div>
65
+ <div class="l-col m-3">
66
+ <span>3 columns</span>
67
+ </div>
68
+ <div class="l-col m-2">
69
+ <span>2 columns</span>
70
+ </div>
71
+ </div>
72
+
73
+ <div class="footer l-container"></div>
74
+ </div>
@@ -0,0 +1,56 @@
1
+ ---
2
+ layout: default
3
+ title: Fluid Grid Examples
4
+ id: fluid
5
+ css: fluid-grid
6
+ menu: grids
7
+ ---
8
+
9
+ <div id="page">
10
+ <div class="l-container">
11
+ {% include shared-grid-samples.html %}
12
+ </div>
13
+
14
+ <div class="l-container m-pixel">
15
+ <header>
16
+ <h2>Forced pixel grid</h2>
17
+ <code>.l-container.m-pixel</code> with no row
18
+ </header>
19
+
20
+ <div class="l-col m-6">
21
+ <span>.l-col-m-6</span>
22
+ </div>
23
+ <div class="l-col m-3">
24
+ <span>.l-col-m-6</span>
25
+ </div>
26
+ <div class="l-col m-3">
27
+ <span>.l-col-m-6</span>
28
+ </div>
29
+
30
+ <div class="l-row m-gutterless">
31
+ <div class="l-col m-9">
32
+ <div class="l-container">
33
+ <span>.l-col-m-9</span>
34
+ <h2>Nested grid 6 columns in a 9 column cell</h2>
35
+ <div class="l-row">
36
+ <div class="l-col m-2-of-8">
37
+ <span>.l-col-m-2-of-6</span>
38
+ </div>
39
+ <div class="l-col m-2-of-8">
40
+ <span>.l-col-m-2-of-6</span>
41
+ </div>
42
+ <div class="l-col m-2-of-8">
43
+ <span>.l-col-m-2-of-6</span>
44
+ </div>
45
+ <div class="l-col m-2-of-8">
46
+ <span>.l-col-m-2-of-6</span>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ <div class="l-col m-3">
52
+ <span>.l-col-m-3</span>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ </div>
@@ -0,0 +1,5 @@
1
+ ---
2
+ layout: default
3
+ title: Grid and Layout Demos
4
+ menu: grids
5
+ ---
@@ -0,0 +1,29 @@
1
+ ---
2
+ layout: default
3
+ title: Pixel Grid Examples
4
+ id: pixel
5
+ css: pixel-grid
6
+ menu: grids
7
+ ---
8
+
9
+ <div id="page">
10
+ <div class="l-container">
11
+ {% include shared-grid-samples.html %}
12
+ </div>
13
+
14
+ <div class="l-container m-fluid">
15
+ <header>
16
+ <h2>No row (gutterless), forced-fluid</h2>
17
+ <code>.m-fluid</code>
18
+ </header>
19
+ <div class="l-col m-6">
20
+ <span>6 columns</span>
21
+ </div>
22
+ <div class="l-col m-3">
23
+ <span>3 columns</span>
24
+ </div>
25
+ <div class="l-col m-3">
26
+ <span>3 columns</span>
27
+ </div>
28
+ </div>
29
+ </div>
Binary file
Binary file
@@ -0,0 +1,15 @@
1
+ var page = require('webpage').create(),
2
+ system = require('system'),
3
+ address, output;
4
+
5
+ if(system.args.lengt < 2) {
6
+ console.log('Usage: capture.js URL filename');
7
+ } else {
8
+ address = system.args[1];
9
+ output = system.args[2];
10
+
11
+ page.open(address, function() {
12
+ page.render(output);
13
+ phantom.exit();
14
+ });
15
+ }
@@ -0,0 +1,71 @@
1
+ // Mock block
2
+
3
+ @mixin block($color: #333, $height: 100px, $padding: 0) {
4
+ $v-guides-color: desaturate(darken($color, 10), 40);
5
+
6
+ -webkit-transition: 400ms;
7
+ background-color: rgba($color, .4);
8
+ position: relative;
9
+ min-height: $height;
10
+ -webkit-transition: box-shadow 800ms ease, background 500ms ease;
11
+ -webkit-transition-delay: 600ms 0;
12
+
13
+ span {
14
+ position: absolute;
15
+ left: 0;
16
+ right: 0;
17
+ top: 50%;
18
+ color: rgba(white, .8);
19
+ height: 30px;
20
+ text-align: center;
21
+ line-height: 30px;
22
+ margin: -15px auto 0;
23
+ max-width: 210px;
24
+ background: $v-guides-color;
25
+ z-index: 2;
26
+ opacity: 0;
27
+ cursor: default;
28
+ font-size: 10px;
29
+ -webkit-transition: 300ms;
30
+ -webkit-border-radius: 20px;
31
+ text-transform: uppercase;
32
+ }
33
+
34
+ &::before {
35
+ position: absolute;
36
+ top: 0;
37
+ left: 0;
38
+ right: 0;
39
+ bottom: 0;
40
+ content: "";
41
+ background: rgba(white, .25);
42
+ margin: $padding;
43
+ }
44
+
45
+ &.l-col::after {
46
+ opacity: 0;
47
+ -webkit-transition: 300ms ease;
48
+ -webkit-transition-delay: 300ms;
49
+ position: absolute;
50
+ top: 50%;
51
+ left: 50%;
52
+ right: 50%;
53
+ border-top: 1px solid $v-guides-color;
54
+ content: "";
55
+ }
56
+
57
+ &:hover {
58
+ background-color: rgba($color, .7);
59
+ box-shadow: inset 0 0 0px 1px $v-guides-color, 0 1px 5px rgba(black, .3);
60
+
61
+ span {
62
+ opacity: 1;
63
+ }
64
+
65
+ &::after {
66
+ opacity: 1;
67
+ left: 0;
68
+ right: 0;
69
+ }
70
+ }
71
+ }
@@ -0,0 +1,111 @@
1
+ // Grid settings
2
+ $grid-guides-color: #8aa8c0;
3
+ $grid-guides-opacity: .2;
4
+
5
+ $grid-type: pixel;
6
+ $grid-size: 1020px;
7
+ $grid-total-columns: 8;
8
+ $grid-desired-gutter: 40px;
9
+ $grid-baseline: 19px;
10
+
11
+ @import "stratum";
12
+ @import "layout/scaffolding";
13
+
14
+ @import "mock-block";
15
+
16
+ // @include GRID-GUIDES;
17
+
18
+ body {
19
+ font: 12px/1.36 Helvetica, Arial, sans-serif;
20
+ color: #444;
21
+ background: #eaeaea;
22
+ padding: 0;
23
+ margin: 0;
24
+ }
25
+
26
+ // Reference
27
+
28
+ .reference {
29
+ position: absolute;
30
+ left: 0;
31
+ right: 0;
32
+ opacity: .35;
33
+ z-index: -1;
34
+
35
+ img {
36
+ margin: 0 auto;
37
+ display: block;
38
+ }
39
+ }
40
+
41
+ // Layout
42
+
43
+ #page {
44
+ padding: 0;
45
+
46
+ .masthead {
47
+ @include block($height: 125px);
48
+ }
49
+
50
+ > nav {
51
+ @include block(blue, $height: 30px);
52
+ }
53
+
54
+ > .content {
55
+ padding: 0 19px;
56
+ min-width: 0;
57
+ width: auto;
58
+
59
+ > .head {
60
+ @include block($height: 58px);
61
+ margin: 15px 0;
62
+ }
63
+
64
+ .content,
65
+ .sidebar {
66
+ @include block(#baaf32, $height: 2438px);
67
+ }
68
+
69
+ .l-container {
70
+ @include grid-container(640px);
71
+ }
72
+
73
+ > .p-title {
74
+ @include block($height: 85px);
75
+ margin-bottom: 10px
76
+ }
77
+ .p-meta {
78
+ @include block($height: 35px);
79
+ margin-bottom: 15px
80
+ }
81
+ .p-image {
82
+ @include block($height: 415px);
83
+ margin-bottom: 15px
84
+ }
85
+ .p-text {
86
+ @include block($height: 1265px);
87
+ }
88
+
89
+ .sidebar {
90
+ width: 300px;
91
+ }
92
+
93
+ .related {
94
+ .l-col.p-title {
95
+ @include block(purple, $height: 33px);
96
+ margin: 95px 0 0;
97
+ }
98
+ .l-col {
99
+ @include block(green, $height: 255px);
100
+ margin: 0 0 10px;
101
+ }
102
+ }
103
+ }
104
+
105
+ .mastfoot {
106
+ background: rgba(#222, .2);
107
+ .l-col {
108
+ @include block(#444, $height: 337px);
109
+ }
110
+ }
111
+ }
@@ -0,0 +1,93 @@
1
+ // Grid settings
2
+ $grid-guides-color: #8aa8c0;
3
+ $grid-guides-opacity: .2;
4
+
5
+ $grid-type: pixel;
6
+ $grid-size: 976px;
7
+ $grid-total-columns: 8;
8
+ $grid-desired-gutter: 20px;
9
+ $grid-baseline: 19px;
10
+
11
+ @import "stratum";
12
+ @import "layout/scaffolding";
13
+
14
+ @import "mock-block";
15
+
16
+ // @include GRID-GUIDES;
17
+
18
+ body {
19
+ font: 12px/1.36 Helvetica, Arial, sans-serif;
20
+ color: #444;
21
+ background: #eaeaea;
22
+ padding: 0;
23
+ margin: 0;
24
+ }
25
+
26
+ // Reference
27
+
28
+ .reference {
29
+ position: absolute;
30
+ left: 0;
31
+ right: 0;
32
+ opacity: .35;
33
+ z-index: -1;
34
+
35
+ img {
36
+ margin: 0 auto;
37
+ display: block;
38
+ }
39
+ }
40
+
41
+ // Layout
42
+
43
+ #page {
44
+ padding: 0;
45
+
46
+ .top-banner {
47
+ @include block($height: 96px);
48
+ }
49
+
50
+ .nav {
51
+ @include block(blue, $height: 39px);
52
+
53
+ .l-container .l-col {
54
+ @include block(navy, $height: 39px);
55
+ }
56
+ }
57
+
58
+ .hero {
59
+ > .head,
60
+ > .dashboard,
61
+ > nav {
62
+ margin-top: 10px;
63
+ margin-bottom: 10px;
64
+ }
65
+
66
+ > .head .l-col {
67
+ @include block(green, $height: 75px);
68
+ }
69
+
70
+ > .dashboard {
71
+ .p-item {
72
+ @include block(purple, $height: 217px, $padding: 7px);
73
+ }
74
+
75
+ .m-right .p-item {
76
+ height: 434px;
77
+ }
78
+ }
79
+
80
+ > nav {
81
+ @include block($height: 63px);
82
+ }
83
+ }
84
+
85
+ .content .l-col {
86
+ @include block(#baaf32, $height: 511px, $padding: $grid-gutter/2);
87
+ }
88
+
89
+ .footer {
90
+ @include block(#444, $height: 105px, $padding: $grid-gutter/2);
91
+ margin-top: 10px;
92
+ }
93
+ }
@@ -0,0 +1,44 @@
1
+ $grid-type: fluid;
2
+
3
+ @import "stratum";
4
+ @import "layout/scaffolding";
5
+
6
+ @import "mock-block";
7
+
8
+ @include GRID-GUIDES;
9
+
10
+
11
+ .l-container {
12
+ width: 80%;
13
+ min-width: 0;
14
+
15
+ &.m-pixel {
16
+ width: $grid-size;
17
+ min-width: $grid-size;
18
+ }
19
+ }
20
+ .l-container .l-col {
21
+ @include block($height: 120px, $padding: $grid-gutter/2);
22
+
23
+ &.m-12 {
24
+ @include block(#777, $height: 150px);
25
+ }
26
+ }
27
+
28
+
29
+ .l-container .l-container {
30
+ position: relative;
31
+ @include group(true);
32
+
33
+ h2 {
34
+ margin: 20px $grid-gutter 10px;
35
+ }
36
+
37
+ .l-col {
38
+ @include block(#ba5232, $height: 150px, $padding: $grid-gutter/2);
39
+
40
+ &:hover {
41
+ z-index: 10;
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,90 @@
1
+ @import "stratum";
2
+
3
+ body {
4
+ font: 12px/1.36 Helvetica, Arial, sans-serif;
5
+ color: #444;
6
+ background: #eee;
7
+ margin: 0;
8
+ padding: 0;
9
+ }
10
+
11
+ h1, h2 {
12
+ margin: ($grid-baseline * 2) 0 $grid-baseline;
13
+ }
14
+
15
+ .l-container {
16
+ > h2,
17
+ > header {
18
+ border-top: 1px solid rgba(black, .2);
19
+ padding-top: $grid-baseline;
20
+ margin-top: $grid-baseline;
21
+
22
+ h2 {
23
+ margin-top: 0;
24
+ }
25
+
26
+ &:first-child,
27
+ .l-col & {
28
+ border: none;
29
+ }
30
+ }
31
+ }
32
+
33
+ #page {
34
+ padding: 20px 0;
35
+ }
36
+
37
+ #masthead {
38
+ background: #444;
39
+ font-size: 13px;
40
+ box-shadow: 0 1px 3px rgba(black, .6);
41
+
42
+ ul {
43
+ @extend %l-container;
44
+ @include group;
45
+ list-style: none;
46
+ margin: 0 auto;
47
+ padding: 0;
48
+ }
49
+
50
+ li {
51
+ float: left;
52
+ }
53
+
54
+ a {
55
+ color: #ddd;
56
+ float: left;
57
+ padding: 8px 10px;
58
+ text-decoration: none;
59
+ }
60
+
61
+ .active a,
62
+ a:hover {
63
+ background: #363636;
64
+ color: white;
65
+ }
66
+
67
+ .active a {
68
+ background: #222;
69
+ }
70
+ }
71
+
72
+ header {
73
+ font-size: 1.5em;
74
+ color: #777;
75
+
76
+ h2 {
77
+ display: inline-block;
78
+ font-size: 1em;
79
+ color: #333;
80
+ }
81
+
82
+ code {
83
+ border-radius: 4px;
84
+ margin: 0 5px;
85
+ padding: 3px;
86
+ background: rgba(#eee, .5);
87
+ color: #ba5232;
88
+ font-size: .9em;
89
+ }
90
+ }
@@ -0,0 +1,14 @@
1
+ $grid-type: pixel;
2
+
3
+
4
+ @import "stratum";
5
+ @import "layout/scaffolding";
6
+
7
+ @import "mock-block";
8
+
9
+ @include GRID-GUIDES;
10
+
11
+
12
+ .l-container .l-col {
13
+ @include block($height: 120px, $padding: $grid-gutter/2);
14
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stratum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &70285764166840 !ruby/object:Gem::Requirement
16
+ requirement: &70294002783300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70285764166840
24
+ version_requirements: *70294002783300
25
25
  description: Stratum is a collection of SASS mixins and utilities for your web development
26
26
  needs.
27
27
  email: tyom@semonov.com
@@ -50,6 +50,27 @@ files:
50
50
  - lib/stratum.rb
51
51
  - lib/version.rb
52
52
  - stratum.gemspec
53
+ - tests/Gemfile
54
+ - tests/Gemfile.lock
55
+ - tests/Guardfile
56
+ - tests/_config.yml
57
+ - tests/_includes/menu-grids.html
58
+ - tests/_includes/shared-grid-samples.html
59
+ - tests/_layouts/default.html
60
+ - tests/grid/arstechnica.html
61
+ - tests/grid/bbc.html
62
+ - tests/grid/fluid.html
63
+ - tests/grid/index.html
64
+ - tests/grid/pixel.html
65
+ - tests/images/arstechnica.png
66
+ - tests/images/bbc.png
67
+ - tests/images/capture.js
68
+ - tests/scss/_mock-block.scss
69
+ - tests/scss/arstechnica.scss
70
+ - tests/scss/bbc.scss
71
+ - tests/scss/fluid-grid.scss
72
+ - tests/scss/main.scss
73
+ - tests/scss/pixel-grid.scss
53
74
  homepage: http://rubygems.org/gems/stratum
54
75
  licenses: []
55
76
  post_install_message: