singularitygs 1.5.1 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a5b03761043033fa5024c387527d4a992b70e69
4
- data.tar.gz: 258f173c9d2581ff1ed235d9f78de225c26ffc11
3
+ metadata.gz: 4a3d06c85dbf8aec621a47396e11270e452c0214
4
+ data.tar.gz: 8e437c8e7a3c0c4932edbe34aefc7a22c77f0101
5
5
  SHA512:
6
- metadata.gz: ab312af3631a10baf1a09ea56a3658a8b7471b2e512eb1c623fcab9d7efdc20f020c4e867afce097ff203ed38b84a3c1729f35a5da6f62e967e0211bf17ad31f
7
- data.tar.gz: 0d3609c4431fd47d3c9edb9c3620469438d9143a3133942cc1642cb66d57f514e7eabad66b93e10a2584ef2f37374bfa8fa741ac3b06324a606ac7d7b3ff97e0
6
+ metadata.gz: bf7db2d617b5e4adc56418b7a33384f8a45065cc6423081b63982e98caa93e4ca667be1e50b11aa4073c21fa6433f33b90ad415e3a376696aab7cb7b8f465704
7
+ data.tar.gz: a9671359f382ab254726d445ad25299e119f8c6f8de4d2a7d5349f159eb1fe7fa352c77b29fcd5077f7a48400a631fda5624fe6f745b434547e6b2639abbd882
@@ -12,6 +12,6 @@ else
12
12
  end
13
13
 
14
14
  module SingularityGS
15
- VERSION = "1.5.1"
16
- DATE = "2015-01-18"
15
+ VERSION = "1.6.1"
16
+ DATE = "2015-02-25"
17
17
  end
@@ -10,12 +10,25 @@
10
10
  $Style: map-get($Span-Map, 'style');
11
11
 
12
12
  @if unitless($Gutter) {
13
- @error "Calc output style uses fixed gutters (gutters with units). Please define fixed gutters to use calc";
13
+ $ERROR-MESSAGE: "Calc output style uses fixed gutters (gutters with units). Please define fixed gutters to use calc";
14
+ @if feature-exists(at-error) {
15
+ @error $ERROR-MESSAGE;
16
+ }
17
+ @else {
18
+ @warn $ERROR-MESSAGE;
19
+ }
14
20
  @return $Return;
15
21
  }
16
22
 
17
23
  @if type-of($Grid) == 'number' {
18
- @error "Calc output style is designed to be used with asymmetric grids, especially with a mix of fixed and fluid columns. Please define an asymmetric grid or use another output style.";
24
+ $ERROR-MESSAGE: "Calc output style is designed to be used with asymmetric grids, especially with a mix of fixed and fluid columns. Please define an asymmetric grid or use another output style.";
25
+ @if feature-exists(at-error) {
26
+ @error $ERROR-MESSAGE;
27
+ }
28
+ @else {
29
+ @warn $ERROR-MESSAGE;
30
+ }
31
+ @return $Return;
19
32
  }
20
33
 
21
34
  $Start-Row: map-get($Span-Map, 'start row');
@@ -35,6 +35,8 @@
35
35
  // -----------------------------------------------
36
36
  // Grid Background
37
37
 
38
+ @import 'str-replace';
39
+
38
40
  @mixin background-grid(
39
41
  $columns: null,
40
42
  $gutter: null,
@@ -172,7 +174,7 @@
172
174
 
173
175
  $Grid-Count: column-count($Grid);
174
176
 
175
- $Gradient: ();
177
+ $SVG: '<svg xmlns="http://www.w3.org/2000/svg">';
176
178
 
177
179
  $Gutter-Width: gutter-span($Gutter, $Grid, $Style);
178
180
  @if unit($Gutter-Width) != '%' and unit($Gutter-Width) != '' {
@@ -191,7 +193,7 @@
191
193
 
192
194
  @if index($Style, 'split') and $i == 1 {
193
195
  $Counter-Width: ($Gutter-Width / 2);
194
- $Gradient: append($Gradient, ($Gutter-Color, $Gutter-Color $Counter-Width), 'comma');
196
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Gutter-Color}" width="#{$Gutter-Width / 2}" height="100%"/>';
195
197
  }
196
198
 
197
199
  $Loop-Color: $Column-Color;
@@ -201,9 +203,9 @@
201
203
 
202
204
  @if $i != $Grid-Count {
203
205
  @if unit($Counter-Width) == unit($Loop-Width) {
204
- $Gradient: append($Gradient, ($Loop-Color $Counter-Width, $Loop-Color ($Counter-Width + $Loop-Width)), 'comma');
206
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Loop-Color}" width="#{$Loop-Width}" height="100%"/>';
205
207
  $Counter-Width: $Counter-Width + $Loop-Width;
206
- $Gradient: append($Gradient, ($Gutter-Color $Counter-Width, $Gutter-Color ($Counter-Width + $Gutter-Width)), 'comma');
208
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Gutter-Color}" width="#{$Gutter-Width}" height="100%"/>';
207
209
  $Counter-Width: $Counter-Width + $Gutter-Width;
208
210
  }
209
211
  @else {
@@ -213,7 +215,8 @@
213
215
  }
214
216
  @else if $i == 1 {
215
217
  @if unit($Counter-Width) == unit($Loop-Width) {
216
- $Gradient: append($Gradient, ($Loop-Color, $Loop-Color $Counter-Width, $Gutter-Color $Counter-Width, $Gutter-Color ($Counter-Width + $Gutter-Width)), 'comma');
218
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Loop-Color}" width="#{$Loop-Width}" height="100%"/>';
219
+ $SVG: $SVG + '<rect x="#{$Loop-Width}" fill="#{$Gutter-Color}" width="#{$Gutter-Width}" height="100%"/>';
217
220
  $Counter-Width: $Counter-Width + $Loop-Width + $Gutter-Width;
218
221
  }
219
222
  @else {
@@ -223,31 +226,35 @@
223
226
  }
224
227
  @else if $i == $Grid-Count and index($Style, 'split') {
225
228
  @if unit($Counter-Width) == unit($Loop-Width) {
226
- $Gradient: append($Gradient, ($Loop-Color $Counter-Width, $Loop-Color ($Counter-Width + $Loop-Width)), 'comma');
229
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Loop-Color}" width="#{$Loop-Width}" height="100%"/>';
227
230
  $Counter-Width: $Counter-Width + $Loop-Width;
228
- $Gradient: append($Gradient, ($Gutter-Color $Counter-Width, $Gutter-Color ($Counter-Width + ($Gutter-Width / 2))), 'comma');
231
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Gutter-Color}" width="#{$Gutter-Width / 2}" height="100%"/>';
229
232
  }
230
233
  @else {
231
234
  $Display: false;
232
235
  }
233
236
  }
234
237
  @else {
235
- $Gradient: append($Gradient, ($Loop-Color $Counter-Width, $Loop-Color), 'comma');
238
+ $SVG: $SVG + '<rect x="#{$Counter-Width}" fill="#{$Loop-Color}" width="#{$Loop-Width}" height="100%"/>';
236
239
  }
237
240
  }
238
241
 
242
+ $SVG: $SVG + '</svg>';
243
+ $SVG: url-encode($SVG);
244
+
239
245
  @if $Display {
246
+
240
247
  @if $bkpt != -1px {
241
248
  @include breakpoint($bkpt) {
242
- background-image: unquote('linear-gradient(to #{opposite-direction($Direction)}, #{$Gradient})');
249
+ background-image: url('data:image/svg+xml,' + $SVG);
243
250
  }
244
251
  }
245
252
  @else {
246
- background-image: unquote('linear-gradient(to #{opposite-direction($Direction)}, #{$Gradient})');
253
+ background-image: url('data:image/svg+xml,' + $SVG);
247
254
  }
248
255
  }
249
256
  @else {
250
- @warn 'Cannot generate a CSS gradient for grid `#{$Grid}` with gutters `#{$Gutter}` and gutter style `#{$Style}`';
257
+ @warn 'Cannot generate a Background Grid for grid `#{$Grid}` with gutters `#{$Gutter}` and gutter style `#{$Style}`';
251
258
  }
252
259
  }
253
260
  }
@@ -0,0 +1,145 @@
1
+ // From http://sassmeister.com/gist/1b4f2da5527830088e4d
2
+
3
+ ////
4
+ // I have written a lot of different `str-replace` Sass functions over
5
+ // the months yet none of my tries were succeeding in making the new substring
6
+ // able to contain the one to replace (e.g. `str-replace($str, 'a', 'ab')`).
7
+ // Thanks to Valérian Galliat (@valeriangalliat), I finally managed to build
8
+ // a bulletproof `str-replace` Sass function that allows new string to contain
9
+ // the old one.
10
+ ////
11
+
12
+ /// Replace `$search` with `$replace` in `$string`
13
+ /// @param {String} $string - Initial string
14
+ /// @param {String} $search - Substring to replace
15
+ /// @param {String} $replace ('') - New value
16
+ /// @return {String} - Updated string
17
+ @function str-replace($string, $search, $replace: '') {
18
+ $index: str-index($string, $search);
19
+
20
+ @if $index {
21
+ @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
22
+ }
23
+
24
+ @return $string;
25
+ }
26
+
27
+ @function url-encode($string) {
28
+ $encodeMap:('%':'%25',
29
+ ' ':'%20',
30
+ '!':'%21',
31
+ '\"':'%22',
32
+ '#':'%23',
33
+ '$':'%24',
34
+ '&':'%26',
35
+ '\'':'%27',
36
+ '(':'%28',
37
+ ')':'%29',
38
+ '*':'%2A',
39
+ '+':'%2B',
40
+ ',':'%2C',
41
+ '-':'%2D',
42
+ '.':'%2E',
43
+ '/':'%2F',
44
+ ':':'%3A',
45
+ ';':'%3B',
46
+ '<':'%3C',
47
+ '=':'%3D',
48
+ '>':'%3E',
49
+ '?':'%3F',
50
+ '@':'%40',
51
+ '[':'%5B',
52
+ '\\':'%5C',
53
+ ']':'%5D',
54
+ '^':'%5E',
55
+ '_':'%5F',
56
+ '`':'%60',
57
+ '{':'%7B',
58
+ '|':'%7C',
59
+ '}':'%7D',
60
+ '~':'%7E',
61
+ '¢':'%A2',
62
+ '£':'%A3',
63
+ '¥':'%A5',
64
+ '§':'%A7',
65
+ '«':'%AB',
66
+ '¬':'%AC',
67
+ '¯':'%AD',
68
+ 'º':'%B0',
69
+ '±':'%B1',
70
+ 'ª':'%B2',
71
+ 'µ':'%B5',
72
+ '»':'%BB',
73
+ '¼':'%BC',
74
+ '½':'%BD',
75
+ '¿':'%BF',
76
+ 'À':'%C0',
77
+ 'Á':'%C1',
78
+ 'Â':'%C2',
79
+ 'Ã':'%C3',
80
+ 'Ä':'%C4',
81
+ 'Å':'%C5',
82
+ 'Æ':'%C6',
83
+ 'Ç':'%C7',
84
+ 'È':'%C8',
85
+ 'É':'%C9',
86
+ 'Ê':'%CA',
87
+ 'Ë':'%CB',
88
+ 'Ì':'%CC',
89
+ 'Í':'%CD',
90
+ 'Î':'%CE',
91
+ 'Ï':'%CF',
92
+ 'Ð':'%D0',
93
+ 'Ñ':'%D1',
94
+ 'Ò':'%D2',
95
+ 'Ó':'%D3',
96
+ 'Ô':'%D4',
97
+ 'Õ':'%D5',
98
+ 'Ö':'%D6',
99
+ 'Ø':'%D8',
100
+ 'Ù':'%D9',
101
+ 'Ú':'%DA',
102
+ 'Û':'%DB',
103
+ 'Ü':'%DC',
104
+ 'Ý':'%DD',
105
+ 'Þ':'%DE',
106
+ 'ß':'%DF',
107
+ 'à':'%E0',
108
+ 'á':'%E1',
109
+ 'â':'%E2',
110
+ 'ã':'%E3',
111
+ 'ä':'%E4',
112
+ 'å':'%E5',
113
+ 'æ':'%E6',
114
+ 'ç':'%E7',
115
+ 'è':'%E8',
116
+ 'é':'%E9',
117
+ 'ê':'%EA',
118
+ 'ë':'%EB',
119
+ 'ì':'%EC',
120
+ 'í':'%ED',
121
+ 'î':'%EE',
122
+ 'ï':'%EF',
123
+ 'ð':'%F0',
124
+ 'ñ':'%F1',
125
+ 'ò':'%F2',
126
+ 'ó':'%F3',
127
+ 'ô':'%F4',
128
+ 'õ':'%F5',
129
+ 'ö':'%F6',
130
+ '÷':'%F7',
131
+ 'ø':'%F8',
132
+ 'ù':'%F9',
133
+ 'ú':'%FA',
134
+ 'û':'%FB',
135
+ 'ü':'%FC',
136
+ 'ý':'%FD',
137
+ 'þ':'%FE',
138
+ 'ÿ':'%FF'
139
+ );
140
+
141
+ @each $char, $code in $encodeMap {
142
+ $string: str-replace($string, $char, $code);
143
+ }
144
+ @return $string;
145
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: singularitygs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Kellum
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-18 00:00:00.000000000 Z
12
+ date: 2015-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass
@@ -77,6 +77,7 @@ files:
77
77
  - stylesheets/singularitygs/helpers/_settings.scss
78
78
  - stylesheets/singularitygs/helpers/_sort.scss
79
79
  - stylesheets/singularitygs/helpers/_span-shared.scss
80
+ - stylesheets/singularitygs/helpers/_str-replace.scss
80
81
  - stylesheets/singularitygs/language/_parse-add.scss
81
82
  - stylesheets/singularitygs/language/_parse-list.scss
82
83
  - stylesheets/singularitygs/language/_span.scss