singularitygs 1.0.8 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/lib/singularitygs.rb +2 -2
- data/stylesheets/_singularitygs.scss +10 -1
- data/stylesheets/singularitygs/_gutter-styles.scss +3 -0
- data/stylesheets/singularitygs/api/_float.scss +59 -6
- data/stylesheets/singularitygs/api/_isolation.scss +77 -8
- data/stylesheets/singularitygs/gutter-styles/_add.scss +29 -0
- data/stylesheets/singularitygs/gutter-styles/_find.scss +16 -0
- data/stylesheets/singularitygs/gutter-styles/_helpers.scss +34 -0
- data/stylesheets/singularitygs/helpers/_background-grid.scss +52 -18
- data/stylesheets/singularitygs/math/_columns.scss +20 -3
- data/stylesheets/singularitygs/math/_grid.scss +2 -2
- data/stylesheets/singularitygs/math/_gutters.scss +5 -1
- data/templates/grid-toggle/grid.js +16 -0
- data/templates/grid-toggle/grid.min.js +2 -0
- data/templates/grid-toggle/manifest.rb +22 -0
- metadata +15 -29
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ed6023075e476e09f02f7dc441db430c8aa241ad
|
4
|
+
data.tar.gz: 7993b36ef6298f9ffabccbaca24750e69620e646
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 21fb8df44deeac78133614d6098e6cd40056a9d6320af3145bd8052e0fee5ad038ff3b475796eaa7f57627673f16d08fd6241d7457d0e7054febc365dd604fdf
|
7
|
+
data.tar.gz: c3f1e12ba84dede2ab07de14d277654f9e5bf94274b561e0db6cc4bc89c5e9f8fd9e4201ae3f0072c83a3480a3c0e054798038be4ee7f033762d6d8f487a4226
|
data/lib/singularitygs.rb
CHANGED
@@ -13,8 +13,12 @@ $grids: () !default;
|
|
13
13
|
// The gutters of the inner columns of the grid
|
14
14
|
$gutters: () !default;
|
15
15
|
|
16
|
+
// The gutter styles
|
17
|
+
// Options: opposite/split (fixed)
|
18
|
+
$gutter-styles: () !default;
|
19
|
+
|
16
20
|
// Specifies whether or not you're building mobile-first grids. Defaults to true
|
17
|
-
$mobile-first: true;
|
21
|
+
$mobile-first: true !default;
|
18
22
|
|
19
23
|
// Default output style.
|
20
24
|
$output: 'isolation' !default;
|
@@ -51,6 +55,11 @@ $include-clearfix: false !default;
|
|
51
55
|
//////////////////////////////
|
52
56
|
@import "singularitygs/gutters";
|
53
57
|
|
58
|
+
//////////////////////////////
|
59
|
+
// Import Gutter Styles
|
60
|
+
//////////////////////////////
|
61
|
+
@import "singularitygs/gutter-styles";
|
62
|
+
|
54
63
|
//////////////////////////////
|
55
64
|
// Import APIs
|
56
65
|
//////////////////////////////
|
@@ -13,9 +13,13 @@
|
|
13
13
|
}
|
14
14
|
|
15
15
|
$gutter: find-gutter($gutter);
|
16
|
+
$gutter-span: gutter-span($gutter, $columns);
|
16
17
|
$end-row: end-row($span, $location, $columns);
|
17
18
|
$start-row: start-row($location);
|
18
19
|
|
20
|
+
$gutter-style: find-gutter-style();
|
21
|
+
$fixed-gutter: fixed-gutter($columns, $gutter);
|
22
|
+
$gutter-property: gutter-property($columns, $gutter);
|
19
23
|
|
20
24
|
width: column-span($span, $location-holder, $columns, $gutter);
|
21
25
|
|
@@ -30,16 +34,38 @@
|
|
30
34
|
|
31
35
|
@if $end-row {
|
32
36
|
float: $opp;
|
33
|
-
|
37
|
+
@if index($gutter-style, split) and not $fixed-gutter {
|
38
|
+
#{$gutter-property}-#{$dir}: 0;
|
39
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
40
|
+
}
|
41
|
+
@else if not $fixed-gutter {
|
42
|
+
#{$gutter-property}-#{$opp}: 0;
|
43
|
+
}
|
34
44
|
}
|
35
45
|
@else {
|
36
46
|
float: $dir;
|
37
47
|
|
38
48
|
@if $start-row {
|
39
|
-
|
49
|
+
@if index($gutter-style, split) and not $fixed-gutter {
|
50
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
51
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
52
|
+
}
|
53
|
+
@else if not $fixed-gutter {
|
54
|
+
#{$gutter-property}-#{$dir}: 0;
|
55
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
56
|
+
}
|
40
57
|
|
41
58
|
}
|
42
|
-
|
59
|
+
}
|
60
|
+
|
61
|
+
@if $fixed-gutter {
|
62
|
+
@if index($gutter-style, split) {
|
63
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
64
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
65
|
+
}
|
66
|
+
@else {
|
67
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
68
|
+
}
|
43
69
|
}
|
44
70
|
}
|
45
71
|
|
@@ -56,15 +82,42 @@
|
|
56
82
|
|
57
83
|
@if $end-row {
|
58
84
|
float: $opp;
|
59
|
-
|
85
|
+
@if index($gutter-style, split) and not $fixed-gutter {
|
86
|
+
#{$gutter-property}-#{$dir}: 0;
|
87
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
88
|
+
}
|
89
|
+
@else if not $fixed-gutter {
|
90
|
+
#{$gutter-property}-#{$opp}: 0;
|
91
|
+
}
|
60
92
|
}
|
61
93
|
@else {
|
62
94
|
float: $dir;
|
63
95
|
|
64
96
|
@if $start-row {
|
65
|
-
|
97
|
+
@if index($gutter-style, split) and not $fixed-gutter {
|
98
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
99
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
100
|
+
}
|
101
|
+
@else if not $fixed-gutter {
|
102
|
+
#{$gutter-property}-#{$dir}: 0;
|
103
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
|
108
|
+
@if $fixed-gutter {
|
109
|
+
@if $direction == 'rtl' {
|
110
|
+
@if index($gutter-style, split) {
|
111
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
112
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
113
|
+
}
|
114
|
+
@else {
|
115
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
@else if not index($gutter-style, split) {
|
119
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
66
120
|
}
|
67
|
-
margin-#{$opp}: gutter-span($gutter, $columns);
|
68
121
|
}
|
69
122
|
}
|
70
123
|
}
|
@@ -1,9 +1,22 @@
|
|
1
1
|
@mixin output-isolation($span, $location, $columns, $gutter, $options: false) {
|
2
2
|
|
3
3
|
$gutter: find-gutter($gutter);
|
4
|
+
$gutter-span: gutter-span($gutter, $columns);
|
4
5
|
$end-row: end-row($span, $location, $columns);
|
5
6
|
$start-row: start-row($location);
|
6
7
|
|
8
|
+
$gutter-style: find-gutter-style();
|
9
|
+
$fixed-gutter: fixed-gutter($columns, $gutter);
|
10
|
+
$gutter-property: gutter-property($columns, $gutter);
|
11
|
+
$split: index($gutter-style, split);
|
12
|
+
|
13
|
+
$margin-span: column-span(($location - 1), 1, $columns);
|
14
|
+
|
15
|
+
@if not $fixed-gutter {
|
16
|
+
$margin-span: $margin-span + $gutter-span;
|
17
|
+
}
|
18
|
+
|
19
|
+
|
7
20
|
// @debug $options;
|
8
21
|
|
9
22
|
|
@@ -16,25 +29,38 @@
|
|
16
29
|
|
17
30
|
width: column-span($span, $location, $columns);
|
18
31
|
|
19
|
-
|
20
|
-
|
21
32
|
// If we are at the last item in the row, we float it the opposite direction
|
22
33
|
@if ($end-row) {
|
23
34
|
float: $opp;
|
24
35
|
margin-#{$dir}: 0;
|
25
|
-
|
36
|
+
@if $split and not $fixed-gutter {
|
37
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
38
|
+
}
|
39
|
+
@else {
|
40
|
+
margin-#{$opp}: 0;
|
41
|
+
}
|
26
42
|
}
|
27
43
|
@else {
|
28
44
|
float: $dir;
|
29
45
|
margin-#{$opp}: -100%;
|
30
46
|
|
31
47
|
@if $start-row {
|
32
|
-
|
48
|
+
@if $split and not $fixed-gutter {
|
49
|
+
margin-#{$dir}: $gutter-span / 2;
|
50
|
+
}
|
51
|
+
@else {
|
52
|
+
margin-#{$dir}: 0%;
|
53
|
+
}
|
33
54
|
}
|
34
55
|
@else {
|
35
|
-
|
36
|
-
|
56
|
+
@if $split and not $fixed-gutter {
|
57
|
+
margin-#{$dir}: $margin-span + $gutter-span / 2;
|
58
|
+
}
|
59
|
+
@else {
|
60
|
+
margin-#{$dir}: $margin-span;
|
61
|
+
}
|
37
62
|
|
63
|
+
}
|
38
64
|
}
|
39
65
|
|
40
66
|
// If options are set, we clear to that option, otherwise no clear!
|
@@ -44,6 +70,16 @@
|
|
44
70
|
@else {
|
45
71
|
clear: none;
|
46
72
|
}
|
73
|
+
|
74
|
+
@if $fixed-gutter {
|
75
|
+
@if index($gutter-style, split) {
|
76
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
77
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
78
|
+
}
|
79
|
+
@else {
|
80
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
81
|
+
}
|
82
|
+
}
|
47
83
|
}
|
48
84
|
|
49
85
|
@if $direction == 'rtl' or $direction == 'both' {
|
@@ -57,16 +93,34 @@
|
|
57
93
|
// If we are at the last item in the row, we float it the opposite direction
|
58
94
|
@if ($end-row) {
|
59
95
|
float: $opp;
|
96
|
+
margin-#{$dir}: 0;
|
97
|
+
@if $split and not $fixed-gutter {
|
98
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
99
|
+
}
|
100
|
+
@else {
|
101
|
+
margin-#{$opp}: 0;
|
102
|
+
}
|
60
103
|
}
|
61
104
|
@else {
|
62
105
|
float: $dir;
|
63
106
|
margin-#{$opp}: -100%;
|
64
107
|
|
65
108
|
@if $start-row {
|
66
|
-
|
109
|
+
@if $split and not $fixed-gutter {
|
110
|
+
margin-#{$dir}: $gutter-span / 2;
|
111
|
+
}
|
112
|
+
@else {
|
113
|
+
margin-#{$dir}: 0%;
|
114
|
+
}
|
67
115
|
}
|
68
116
|
@else {
|
69
|
-
|
117
|
+
@if $split and not $fixed-gutter {
|
118
|
+
margin-#{$dir}: $margin-span + $gutter-span / 2;
|
119
|
+
}
|
120
|
+
@else {
|
121
|
+
margin-#{$dir}: $margin-span;
|
122
|
+
}
|
123
|
+
|
70
124
|
}
|
71
125
|
}
|
72
126
|
|
@@ -77,6 +131,21 @@
|
|
77
131
|
@else {
|
78
132
|
clear: none;
|
79
133
|
}
|
134
|
+
|
135
|
+
@if $fixed-gutter {
|
136
|
+
@if $direction == 'rtl' {
|
137
|
+
@if index($gutter-style, split) {
|
138
|
+
#{$gutter-property}-#{$dir}: $gutter-span / 2;
|
139
|
+
#{$gutter-property}-#{$opp}: $gutter-span / 2;
|
140
|
+
}
|
141
|
+
@else {
|
142
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
@else if not index($gutter-style, split) {
|
146
|
+
#{$gutter-property}-#{$opp}: $gutter-span;
|
147
|
+
}
|
148
|
+
}
|
80
149
|
}
|
81
150
|
}
|
82
151
|
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Accepts a gutter style definition in the human-readable format. Converts it to the internal format,
|
2
|
+
// appends it to a list of gutter styles and returns the resulting list.
|
3
|
+
//
|
4
|
+
// Note that this function only returns a new list, it does not modify the source list.
|
5
|
+
//
|
6
|
+
// add-gutter-style($gutter-style-definition, $append-to-list)
|
7
|
+
// - $gutter-definition : <definition> See documentation for syntax:
|
8
|
+
// https://github.com/Team-Sass/Singularity/wiki/Creating-Grids
|
9
|
+
// - $append-to-list : [list] A list to append to.
|
10
|
+
// Defaults to $gutters if none is specified.
|
11
|
+
@function add-gutter-style($gutter-style-definition, $append-to-list: $gutter-styles) {
|
12
|
+
$parsed: parse-add($gutter-style-definition); // Converts the definition to a temporary format:
|
13
|
+
// either `((<gutter-style>))` or `((<gutter-style>) (<breakpoint>))`
|
14
|
+
$gutter-style: nth($parsed, 1); // E. g. `(<gutter-style>)`.
|
15
|
+
$breakpoint: nth($parsed, 2); // Either `(<breakpoint>)` or false.
|
16
|
+
$list-length: length($append-to-list);
|
17
|
+
|
18
|
+
// Check whether the definition will be the first one in the list
|
19
|
+
// and whether it has no breakpoint specified.
|
20
|
+
@if $breakpoint == false and $list-length == 0 {
|
21
|
+
// Returns the first item of the list, e. g. `(<gutter-style>)`
|
22
|
+
@return $gutter-style;
|
23
|
+
}
|
24
|
+
@else {
|
25
|
+
// Appends to a comma-separated list of definitions in the internal format
|
26
|
+
// and returns it, e. g. `(<gutter>), (<gutter> <breakpoint>), (<gutter> <breakpoint>)`
|
27
|
+
@return append($append-to-list, ($gutter-style $breakpoint), 'comma');
|
28
|
+
}
|
29
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
//////////////////////////////
|
2
|
+
// Find gutter style
|
3
|
+
//
|
4
|
+
// Finds the gutter style that you are working with.
|
5
|
+
// From Singularity
|
6
|
+
// Must be using Breakpoint to work properly
|
7
|
+
//////////////////////////////
|
8
|
+
@function find-gutter-style($user-gutter-style: false) {
|
9
|
+
|
10
|
+
// We supply a default if the user hasn't set any gutter style and hasn't passed in a custom gutter
|
11
|
+
@if length($gutter-styles) == 0 and $user-gutter-style == false {
|
12
|
+
$user-gutter-style: opposite;
|
13
|
+
}
|
14
|
+
|
15
|
+
@return find-object($gutter-styles, $user-gutter-style);
|
16
|
+
}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@function fixed-gutter($user-columns: false, $user-gutter: false, $user-gutter-style: false) {
|
2
|
+
$grid: find-grid($user-columns);
|
3
|
+
$gutter: find-gutter($user-gutter);
|
4
|
+
$gutter-style: find-gutter-style($user-gutter-style);
|
5
|
+
|
6
|
+
@if index($gutter-style, fixed) {
|
7
|
+
// @debug 'Fixed in output style';
|
8
|
+
@return true;
|
9
|
+
}
|
10
|
+
@else if type-of($grid) == 'number' and not unitless($gutter) {
|
11
|
+
// @debug 'Equal columns with a unit based gutter';
|
12
|
+
@return true;
|
13
|
+
}
|
14
|
+
@else if type-of($grid) == 'list' {
|
15
|
+
@if unit(nth($grid, 1)) != unit($gutter) {
|
16
|
+
// @debug 'Columns and gutters are different units';
|
17
|
+
@return true;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
@else {
|
21
|
+
@return false;
|
22
|
+
}
|
23
|
+
|
24
|
+
@return false;
|
25
|
+
}
|
26
|
+
|
27
|
+
@function gutter-property($user-columns: false, $user-gutter: false, $user-gutter-style: false) {
|
28
|
+
@if fixed-gutter($user-columns, $user-gutter, $user-gutter-style) {
|
29
|
+
@return 'padding';
|
30
|
+
}
|
31
|
+
@else {
|
32
|
+
@return 'margin';
|
33
|
+
}
|
34
|
+
}
|
@@ -43,12 +43,15 @@
|
|
43
43
|
// The overlay is painted over your container's ::after pseudo-element, so we must
|
44
44
|
// give position to the container itself, if relative doesn't suit your layout
|
45
45
|
// it can be replaced by absolute/fixed.
|
46
|
-
$overlay-position:
|
46
|
+
$overlay-position: relative !default;
|
47
47
|
|
48
48
|
// Set the position of the switch.
|
49
|
-
$overlay-switch-position: left bottom
|
49
|
+
$overlay-switch-position: left bottom !default;
|
50
50
|
|
51
|
-
$background-grid-color:
|
51
|
+
$background-grid-color: Chocolate !default;
|
52
|
+
|
53
|
+
// Global variable to show or hide the grid background at will.
|
54
|
+
$show-grid-backgrounds: true !default;
|
52
55
|
|
53
56
|
@mixin grid-overlay (
|
54
57
|
$selector: 'body',
|
@@ -125,24 +128,28 @@ $background-grid-color: Chocolate !default;
|
|
125
128
|
$color: $background-grid-color
|
126
129
|
) {
|
127
130
|
|
128
|
-
$
|
131
|
+
@if $show-grid-backgrounds {
|
132
|
+
$background-length: length($grids);
|
129
133
|
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
134
|
+
@if (not $columns) {
|
135
|
+
$grid: find-grid($columns);
|
136
|
+
@include background-build($grid, $gutter, $color);
|
137
|
+
@if ($grid != $grids) {
|
138
|
+
@for $i from 2 through $background-length {
|
139
|
+
$mq: nth(nth($grids, $i), 2);
|
140
|
+
$grid: nth(nth($grids, $i), 1);
|
137
141
|
|
138
|
-
|
139
|
-
|
142
|
+
@include breakpoint($mq) {
|
143
|
+
@include background-build($grid, $gutter, $color);
|
144
|
+
}
|
140
145
|
}
|
141
146
|
}
|
142
147
|
}
|
143
|
-
|
144
|
-
|
145
|
-
|
148
|
+
@else {
|
149
|
+
@include background-build($columns, $gutter, $color);
|
150
|
+
}
|
151
|
+
|
152
|
+
|
146
153
|
}
|
147
154
|
}
|
148
155
|
|
@@ -150,6 +157,10 @@ $background-grid-color: Chocolate !default;
|
|
150
157
|
$columns: find-grid($columns);
|
151
158
|
$gutter: find-gutter($gutter);
|
152
159
|
|
160
|
+
$gutter-style: find-gutter-style();
|
161
|
+
$fixed-gutter: fixed-gutter($columns, $gutter);
|
162
|
+
$split: index($gutter-style, split);
|
163
|
+
|
153
164
|
$widths: ();
|
154
165
|
$colors: ();
|
155
166
|
|
@@ -160,10 +171,28 @@ $background-grid-color: Chocolate !default;
|
|
160
171
|
$length: nth($columns, 1);
|
161
172
|
}
|
162
173
|
|
163
|
-
|
164
174
|
@for $i from 1 through $length {
|
175
|
+
|
176
|
+
@if ($fixed-gutter or $gutter == 0) and $i % 2 == 0 {
|
177
|
+
$color: darken($color, 15%);
|
178
|
+
}
|
179
|
+
@else if ($fixed-gutter or $gutter == 0) and $i % 2 == 1 {
|
180
|
+
$color: lighten($color, 15%);
|
181
|
+
}
|
182
|
+
|
165
183
|
$column-span: column-span($i, 1, $columns);
|
166
|
-
$gutter-span:
|
184
|
+
$gutter-span: 0;
|
185
|
+
@if $fixed-gutter {
|
186
|
+
$gutter-span: $column-span;
|
187
|
+
}
|
188
|
+
@else {
|
189
|
+
$gutter-span: $column-span + gutter-span($gutter, $columns);
|
190
|
+
}
|
191
|
+
|
192
|
+
@if $i == 1 and $split and not $fixed-gutter {
|
193
|
+
$widths: append($widths, gutter-span($gutter, $columns) / 2);
|
194
|
+
$colors: append($colors, rgba($color, .25));
|
195
|
+
}
|
167
196
|
|
168
197
|
@if $i != $columns {
|
169
198
|
$widths: append($widths, $column-span);
|
@@ -175,6 +204,11 @@ $background-grid-color: Chocolate !default;
|
|
175
204
|
$widths: append($widths, $column-span);
|
176
205
|
$colors: append($colors, rgba($color, .5));
|
177
206
|
}
|
207
|
+
|
208
|
+
@if $i == $length and $split and not $fixed-gutter {
|
209
|
+
$widths: append($widths, $column-span + gutter-span($gutter, $columns) / 2);
|
210
|
+
$colors: append($colors, rgba($color, .25));
|
211
|
+
}
|
178
212
|
}
|
179
213
|
|
180
214
|
@include background-gradient-generate($widths, $colors);
|
@@ -1,12 +1,16 @@
|
|
1
1
|
//////////////////////////////
|
2
2
|
// Find width, in percentages, of the column span
|
3
3
|
//////////////////////////////
|
4
|
-
@function column-span($span, $location, $grid: false, $gutter: false) {
|
4
|
+
@function column-span($span, $location, $grid: false, $gutter: false, $gutter-style: false) {
|
5
5
|
|
6
6
|
// Find the grid and gutters
|
7
7
|
$grid: find-grid($grid);
|
8
8
|
$gutter: find-gutter($gutter);
|
9
9
|
|
10
|
+
@if fixed-gutter($grid, $gutter, $gutter-style) {
|
11
|
+
$gutter: 0;
|
12
|
+
}
|
13
|
+
|
10
14
|
// @debug $grid;
|
11
15
|
// @debug $gutter;
|
12
16
|
|
@@ -49,15 +53,28 @@
|
|
49
53
|
// Find the total sum of the grid
|
50
54
|
//////////////////////////////
|
51
55
|
@function column-sum($grid, $gutter) {
|
56
|
+
$split: if(index(find-gutter-style(), split), true, false);
|
57
|
+
|
52
58
|
@if type-of($grid) == 'number' or length($grid) == 1 {
|
53
|
-
@
|
59
|
+
@if $split {
|
60
|
+
@return nth($grid, 1) + ((column-count(nth($grid, 1))) * nth($gutter, 1));
|
61
|
+
}
|
62
|
+
@else {
|
63
|
+
@return nth($grid, 1) + ((column-count(nth($grid, 1)) - 1) * nth($gutter, 1));
|
64
|
+
}
|
65
|
+
|
54
66
|
}
|
55
67
|
@else if type-of($grid) == 'list' {
|
56
68
|
$sum: 0;
|
57
69
|
@each $column in $grid {
|
58
70
|
$sum: $sum + nth($column, 1);
|
59
71
|
}
|
60
|
-
|
72
|
+
@if $split {
|
73
|
+
$sum: $sum + (column-count($grid)) * nth($gutter, 1);
|
74
|
+
}
|
75
|
+
@else {
|
76
|
+
$sum: $sum + (column-count($grid) - 1) * nth($gutter, 1);
|
77
|
+
}
|
61
78
|
@return $sum;
|
62
79
|
}
|
63
80
|
}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
@function grid-span($span, $location, $grid: false, $gutter: false) {
|
2
|
-
@return column-span($span, $location, $grid, $gutter) + gutter-span($gutter, $grid);
|
1
|
+
@function grid-span($span, $location, $grid: false, $gutter: false, $gutter-style: false) {
|
2
|
+
@return column-span($span, $location, $grid, $gutter, $gutter-style) + gutter-span($gutter, $grid, $gutter-style);
|
3
3
|
}
|
@@ -1,9 +1,13 @@
|
|
1
|
-
@function gutter-span($gutter: false, $grid: false) {
|
1
|
+
@function gutter-span($gutter: false, $grid: false, $gutter-style: false) {
|
2
2
|
|
3
3
|
// Find the columns and gutters
|
4
4
|
$grid: find-grid($grid);
|
5
5
|
$gutter: find-gutter($gutter);
|
6
6
|
|
7
|
+
@if fixed-gutter($grid, $gutter, $gutter-style) {
|
8
|
+
@return nth($gutter, 1);
|
9
|
+
}
|
10
|
+
|
7
11
|
// Combine the columns and gutters
|
8
12
|
$grid-and-gutters: column-sum($grid, $gutter);
|
9
13
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
(function() {
|
2
|
+
window.onload = function() {
|
3
|
+
var body = document.body;
|
4
|
+
body.onkeypress = function(e) {
|
5
|
+
if (e.keyCode == 103 || e.charCode == 103) {
|
6
|
+
var dev = body.getAttribute('data-development-grid');
|
7
|
+
if (dev === null || dev == 'hide') {
|
8
|
+
body.setAttribute('data-development-grid', 'show');
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
body.setAttribute('data-development-grid', 'hide');
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
})();
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*Grid Toggle*/
|
2
|
+
window.onload=function(){var b=document.body;b.onkeypress=function(a){if(103==a.keyCode||103==a.charCode)a=b.getAttribute("data-development-grid"),null===a||"hide"==a?b.setAttribute("data-development-grid","show"):b.setAttribute("data-development-grid","hide")}};
|
@@ -0,0 +1,22 @@
|
|
1
|
+
description "Singularity Grid Toggle"
|
2
|
+
|
3
|
+
discover :javascripts
|
4
|
+
|
5
|
+
help %Q{
|
6
|
+
For help with Singularity, please ask a question on Stack Overflow (http://stackoverflow.com/questions/ask) tagged with "singularitygs".
|
7
|
+
|
8
|
+
To file an issue with Singularity, please use our GitHub Issue Queue (https://github.com/Team-Sass/Singularity/issues).
|
9
|
+
}
|
10
|
+
|
11
|
+
welcome_message %Q{
|
12
|
+
Welcome to Singularity! Grids Without Limits.
|
13
|
+
|
14
|
+
See our Getting Started guide at http://singularity.gs to get started and for full documentation.
|
15
|
+
|
16
|
+
If you need support for IE6/7, you should install the Border Box polyfill. Simply type `compass install singularitygs/box-sizing` in your command line from the root of your project folder (where config.rb is).
|
17
|
+
|
18
|
+
|
19
|
+
For help with Singularity, please ask a question on Stack Overflow (http://stackoverflow.com/questions/ask) tagged with "singularitygs".
|
20
|
+
|
21
|
+
To file an issue with Singularity, please use our GitHub Issue Queue (https://github.com/Team-Sass/Singularity/issues).
|
22
|
+
}
|
metadata
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: singularitygs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 8
|
9
|
-
version: 1.0.8
|
4
|
+
version: 1.1.0
|
10
5
|
platform: ruby
|
11
6
|
authors:
|
12
7
|
- Scott Kellum
|
@@ -15,8 +10,7 @@ autorequire:
|
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
12
|
|
18
|
-
date: 2013-
|
19
|
-
default_executable:
|
13
|
+
date: 2013-07-18 00:00:00 Z
|
20
14
|
dependencies:
|
21
15
|
- !ruby/object:Gem::Dependency
|
22
16
|
name: sass
|
@@ -25,10 +19,6 @@ dependencies:
|
|
25
19
|
requirements:
|
26
20
|
- - ">="
|
27
21
|
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 2
|
31
|
-
- 1
|
32
22
|
version: 3.2.1
|
33
23
|
type: :runtime
|
34
24
|
version_requirements: *id001
|
@@ -39,10 +29,6 @@ dependencies:
|
|
39
29
|
requirements:
|
40
30
|
- - ">="
|
41
31
|
- !ruby/object:Gem::Version
|
42
|
-
segments:
|
43
|
-
- 0
|
44
|
-
- 12
|
45
|
-
- 2
|
46
32
|
version: 0.12.2
|
47
33
|
type: :runtime
|
48
34
|
version_requirements: *id002
|
@@ -53,10 +39,6 @@ dependencies:
|
|
53
39
|
requirements:
|
54
40
|
- - ">="
|
55
41
|
- !ruby/object:Gem::Version
|
56
|
-
segments:
|
57
|
-
- 2
|
58
|
-
- 0
|
59
|
-
- 1
|
60
42
|
version: 2.0.1
|
61
43
|
type: :runtime
|
62
44
|
version_requirements: *id003
|
@@ -75,6 +57,7 @@ files:
|
|
75
57
|
- stylesheets/_singularitygs.scss
|
76
58
|
- stylesheets/singularitygs/_api.scss
|
77
59
|
- stylesheets/singularitygs/_grids.scss
|
60
|
+
- stylesheets/singularitygs/_gutter-styles.scss
|
78
61
|
- stylesheets/singularitygs/_gutters.scss
|
79
62
|
- stylesheets/singularitygs/_helpers.scss
|
80
63
|
- stylesheets/singularitygs/_language.scss
|
@@ -83,6 +66,9 @@ files:
|
|
83
66
|
- stylesheets/singularitygs/api/_isolation.scss
|
84
67
|
- stylesheets/singularitygs/grids/_add.scss
|
85
68
|
- stylesheets/singularitygs/grids/_find.scss
|
69
|
+
- stylesheets/singularitygs/gutter-styles/_add.scss
|
70
|
+
- stylesheets/singularitygs/gutter-styles/_find.scss
|
71
|
+
- stylesheets/singularitygs/gutter-styles/_helpers.scss
|
86
72
|
- stylesheets/singularitygs/gutters/_add.scss
|
87
73
|
- stylesheets/singularitygs/gutters/_find.scss
|
88
74
|
- stylesheets/singularitygs/helpers/_background-grid.scss
|
@@ -109,14 +95,19 @@ files:
|
|
109
95
|
- templates/demos/float.html.erb
|
110
96
|
- templates/demos/isolation.html.erb
|
111
97
|
- templates/demos/manifest.rb
|
98
|
+
- templates/grid-toggle/grid.js
|
99
|
+
- templates/grid-toggle/grid.min.js
|
100
|
+
- templates/grid-toggle/manifest.rb
|
112
101
|
- templates/project/grid.js
|
113
102
|
- templates/project/grid.min.js
|
114
103
|
- templates/project/manifest.rb
|
115
104
|
- templates/project/partials/_base.scss
|
116
105
|
- templates/project/style.scss
|
117
|
-
has_rdoc: true
|
118
106
|
homepage: http://singularity.gs
|
119
|
-
licenses:
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
- GPL
|
110
|
+
metadata: {}
|
120
111
|
|
121
112
|
post_install_message:
|
122
113
|
rdoc_options: []
|
@@ -127,23 +118,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
118
|
requirements:
|
128
119
|
- - ">="
|
129
120
|
- !ruby/object:Gem::Version
|
130
|
-
segments:
|
131
|
-
- 0
|
132
121
|
version: "0"
|
133
122
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
123
|
requirements:
|
135
124
|
- - ">="
|
136
125
|
- !ruby/object:Gem::Version
|
137
|
-
segments:
|
138
|
-
- 1
|
139
|
-
- 2
|
140
126
|
version: "1.2"
|
141
127
|
requirements: []
|
142
128
|
|
143
129
|
rubyforge_project: singularitygs
|
144
|
-
rubygems_version:
|
130
|
+
rubygems_version: 2.0.3
|
145
131
|
signing_key:
|
146
|
-
specification_version:
|
132
|
+
specification_version: 4
|
147
133
|
summary: Singularity is a fluid grid system that can generate uniform columns as well as asymmetric and compound grids. It is designed to be extensable, adding additional outputs or grid generators are easy, and the core syntax is simple to build upon for custom input syntaxes.
|
148
134
|
test_files: []
|
149
135
|
|