sugarcss 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sugarcss.rb +2 -2
- data/stylesheets/sugar/_animations.scss +3 -3
- data/stylesheets/sugar/_effects.scss +110 -0
- data/stylesheets/sugar/_helper-mixins.scss +140 -26
- data/stylesheets/sugar/_sugar.scss +44 -5
- data/stylesheets/sugar/_typo.scss +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a0d9bafb647b37300914c53cd6b1c818cadab8c
|
4
|
+
data.tar.gz: fe240a9dbce7dc1c99eac6275edcce94ae7d148d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 114ce415ff8142dc36d4623b240964031eb3597d5dce6a17aa85f75630ddbd0457b2a3e1a599a557b26aeea6295eacc961f14d53ce95b62921ce902ac56e7a58
|
7
|
+
data.tar.gz: 5539d4ec728cd50cdd568b39fa657650f3fc7e174141b42af650734480e715db7ea6cb60d1ec1c9728279f153fc75a5f1fb4290f4ceb53b8a31ec40682aa6eed
|
data/lib/sugarcss.rb
CHANGED
@@ -17,8 +17,8 @@ Compass::Frameworks.register('sugarcss', :path => extension_path)
|
|
17
17
|
# a prerelease version
|
18
18
|
# Date is in the form of YYYY-MM-DD
|
19
19
|
module Extension
|
20
|
-
VERSION = "1.0.
|
21
|
-
DATE = "2015-11-
|
20
|
+
VERSION = "1.0.1"
|
21
|
+
DATE = "2015-11-23"
|
22
22
|
end
|
23
23
|
|
24
24
|
# This is where any custom SassScript should be placed. The functions will be
|
@@ -15,13 +15,13 @@
|
|
15
15
|
$previous_duration : 0;
|
16
16
|
@each $animation in $animations {
|
17
17
|
$animation : _sugar-parse-properties($animation, (
|
18
|
+
iteration : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 infinite initial inherit,
|
19
|
+
direction : normal reverse alternate alternate-reverse initial inherit,
|
20
|
+
fill-mode : none forwards backwards both initial inherit,
|
18
21
|
name : string,
|
19
22
|
duration : number,
|
20
23
|
delay : number,
|
21
24
|
ease : string,
|
22
|
-
iteration : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 infinite initial inherit,
|
23
|
-
direction : normal reverse alternate alternate-reverse initial inherit,
|
24
|
-
fill-mode : none forwards backwards both initial inherit,
|
25
25
|
parallel : true
|
26
26
|
), (
|
27
27
|
name : n,
|
@@ -2,6 +2,116 @@
|
|
2
2
|
// Effects specific
|
3
3
|
//
|
4
4
|
|
5
|
+
//
|
6
|
+
// Hey
|
7
|
+
//
|
8
|
+
|
9
|
+
@mixin s-hey(
|
10
|
+
$props : ()
|
11
|
+
) {
|
12
|
+
$props : _sugar-parse-properties($props, (
|
13
|
+
vertical-align : top middle bottom,
|
14
|
+
align : left center right,
|
15
|
+
size : number,
|
16
|
+
color : color,
|
17
|
+
margin-left : number,
|
18
|
+
margin-top : number,
|
19
|
+
margin-bottom : number,
|
20
|
+
margin-right : number
|
21
|
+
));
|
22
|
+
|
23
|
+
$props : _sugar-handle-nested(hey, $props);
|
24
|
+
|
25
|
+
$vertical-align : map-get-or($props, vertical-align, top);
|
26
|
+
$align : map-get-or($props, align, right);
|
27
|
+
$size : map-get-or($props, size, 20px);
|
28
|
+
$color : map-get-or($props, color, gold);
|
29
|
+
$margin-left : map-get-or($props, margin-left, 0px);
|
30
|
+
$margin-right : map-get-or($props, margin-right, 0px);
|
31
|
+
$margin-top : map-get-or($props, margin-top, 0px);
|
32
|
+
$margin-bottom : map-get-or($props, margin-bottom, 0px);
|
33
|
+
|
34
|
+
$position : s-position($vertical-align $align);
|
35
|
+
|
36
|
+
@keyframes s-hey {
|
37
|
+
from {
|
38
|
+
opacity: 1;
|
39
|
+
}
|
40
|
+
to {
|
41
|
+
opacity: 0;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
position: relative;
|
46
|
+
&:before {
|
47
|
+
$ratio : 2;
|
48
|
+
$s : round($size / $ratio);
|
49
|
+
content: '';
|
50
|
+
position: absolute;
|
51
|
+
// top : ($size / 2 - $s / 2) + $top;
|
52
|
+
// right : ($size / 2 - $s / 2) + $right;
|
53
|
+
height: $s; width: $s;
|
54
|
+
@include s-corner($s);
|
55
|
+
background-color: $color;
|
56
|
+
|
57
|
+
@each $prop, $value in $position {
|
58
|
+
@if $prop == top or $prop == bottom or $prop == left or $prop == right {
|
59
|
+
@if $prop == top and $value > 0%
|
60
|
+
or $prop == left and $value > 0% {
|
61
|
+
$value : "#{$value} - #{($size / 2 - $s / 2)}";
|
62
|
+
} @else {
|
63
|
+
$value : "#{$value} + #{($size / 2 - $s / 2)}";
|
64
|
+
}
|
65
|
+
@if $prop == top {
|
66
|
+
$value : "#{$value} + #{$margin-top} - #{$margin-bottom}";
|
67
|
+
} @else if $prop == right {
|
68
|
+
$value : "#{$value} + #{$margin-right} - #{$margin-left}";
|
69
|
+
} @else if $prop == bottom {
|
70
|
+
$value : "#{$value} + #{$margin-bottom} - #{$margin-top}";
|
71
|
+
} @else if $prop == left {
|
72
|
+
$value : "#{$value} + #{$margin-left} - #{$margin-right}";
|
73
|
+
}
|
74
|
+
@if $prop != position or $prop != transform {
|
75
|
+
#{$prop} : calc(#{$value});
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
}
|
81
|
+
&:after {
|
82
|
+
$border-width : floor(($size - $size / 2) / 3.5);
|
83
|
+
content: '';
|
84
|
+
position: absolute;
|
85
|
+
// top: $top; right: $right;
|
86
|
+
height: $size - $border-width * 2; width: $size - $border-width * 2;
|
87
|
+
@include s-corner(s-rem($size / 2));
|
88
|
+
background-color: transparent;
|
89
|
+
border: solid $color;
|
90
|
+
border-width: $border-width; // animates
|
91
|
+
boz-sizing: border-box;
|
92
|
+
@include s-animation(s-hey infinite);
|
93
|
+
|
94
|
+
@each $prop, $value in $position {
|
95
|
+
@if $prop == top {
|
96
|
+
$value : "#{$value} + #{$margin-top} - #{$margin-bottom}";
|
97
|
+
} @else if $prop == right {
|
98
|
+
$value : "#{$value} + #{$margin-right} - #{$margin-left}";
|
99
|
+
} @else if $prop == bottom {
|
100
|
+
$value : "#{$value} + #{$margin-bottom} - #{$margin-top}";
|
101
|
+
} @else if $prop == left {
|
102
|
+
$value : "#{$value} + #{$margin-left} - #{$margin-right}";
|
103
|
+
}
|
104
|
+
@if $prop != position or $prop != transform {
|
105
|
+
#{$prop} : calc(#{$value});
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
@include _sugar-handle-nested(hey) {
|
111
|
+
@content;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
5
115
|
//
|
6
116
|
// Shade
|
7
117
|
//
|
@@ -2,6 +2,102 @@
|
|
2
2
|
// Some helpers mixins
|
3
3
|
//
|
4
4
|
|
5
|
+
//
|
6
|
+
// Side lined
|
7
|
+
//
|
8
|
+
@mixin s-side-lined(
|
9
|
+
$props : ()
|
10
|
+
) {
|
11
|
+
$props : _sugar-parse-properties($props, (
|
12
|
+
style : none hidden dotted dashed solid double groove ridge inset outset initial inherit,
|
13
|
+
side : left right both,
|
14
|
+
height : number,
|
15
|
+
width : number,
|
16
|
+
color : color,
|
17
|
+
padding : number,
|
18
|
+
margin-top : number
|
19
|
+
), (
|
20
|
+
style : stl,
|
21
|
+
side : si,
|
22
|
+
padding : p,
|
23
|
+
margin-top : mt
|
24
|
+
));
|
25
|
+
|
26
|
+
$s : _sugar-handle-nested(side-lined, $props);
|
27
|
+
|
28
|
+
$side : map-get-or($props, side, both);
|
29
|
+
$height : map-get-or($props, height, s-rem(1px));
|
30
|
+
$width : map-get-or($props, width, 50%);
|
31
|
+
$color : map-get-or($props, color, black);
|
32
|
+
$style : map-get-or($props, style, solid);
|
33
|
+
$margin-top : map-get($props, margin-top);
|
34
|
+
$padding : map-get-or($props, padding, 0);
|
35
|
+
|
36
|
+
display: block;
|
37
|
+
overflow: hidden;
|
38
|
+
min-height : 1.2em;
|
39
|
+
|
40
|
+
@if $side == both {
|
41
|
+
text-align: center;
|
42
|
+
} @else if $side == left {
|
43
|
+
text-align: right;
|
44
|
+
} @else if $side == right {
|
45
|
+
text-align: left;
|
46
|
+
}
|
47
|
+
|
48
|
+
$sel : '&:before, &:after';
|
49
|
+
@if $side == left {
|
50
|
+
$sel : '&:before';
|
51
|
+
} @else if $side == right {
|
52
|
+
$sel : '&:after';
|
53
|
+
}
|
54
|
+
|
55
|
+
#{$sel} {
|
56
|
+
content: "";
|
57
|
+
display: inline-block;
|
58
|
+
vertical-align: middle;
|
59
|
+
position: relative;
|
60
|
+
width: $width;
|
61
|
+
|
62
|
+
border-top-style: $style;
|
63
|
+
border-top-width: $height;
|
64
|
+
|
65
|
+
@if $color != inherit {
|
66
|
+
border-top-color: $color;
|
67
|
+
}
|
68
|
+
|
69
|
+
@if $style == double {
|
70
|
+
height : $height * 2;
|
71
|
+
border-bottom-style: solid;
|
72
|
+
border-bottom-width: $height;
|
73
|
+
border-bottom-color: $color;
|
74
|
+
}
|
75
|
+
|
76
|
+
@if $margin-top {
|
77
|
+
bottom: $margin-top;
|
78
|
+
} @else {
|
79
|
+
bottom : 0.05em;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
@if $side == left or $side == both {
|
84
|
+
&:before {
|
85
|
+
right: $padding;
|
86
|
+
margin-left: -50%;
|
87
|
+
}
|
88
|
+
}
|
89
|
+
@if $side == right or $side == both {
|
90
|
+
&:after {
|
91
|
+
left: $padding;
|
92
|
+
margin-right: -50%;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
@include _sugar-handle-nested(side-lined) {
|
97
|
+
@content;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
|
5
101
|
//
|
6
102
|
// Position
|
7
103
|
//
|
@@ -68,80 +164,80 @@
|
|
68
164
|
@if $vertical-align or $align {
|
69
165
|
// top
|
70
166
|
@if $vertical-align == top {
|
71
|
-
$return : map-set($return, top, 0);
|
167
|
+
$return : map-set($return, top, 0%);
|
72
168
|
@if $align == left {
|
73
|
-
$return : map-set($return, left, 0);
|
169
|
+
$return : map-set($return, left, 0%);
|
74
170
|
} @else if $align == center {
|
75
171
|
$return : map-set($return, left, 50%);
|
76
|
-
$return : map-merge($return, s-translate(-50% 0));
|
172
|
+
$return : map-merge($return, s-translate(-50% 0%));
|
77
173
|
} @else if $align == right {
|
78
|
-
$return : map-set($return, right, 0);
|
174
|
+
$return : map-set($return, right, 0%);
|
79
175
|
} @else {
|
80
|
-
$return : map-set($return, left, 0);
|
176
|
+
$return : map-set($return, left, 0%);
|
81
177
|
}
|
82
178
|
} @else if $vertical-align == middle {
|
83
179
|
$return : map-set($return, top, 50%);
|
84
180
|
@if $align == left {
|
85
|
-
$return : map-set($return, left, 0);
|
181
|
+
$return : map-set($return, left, 0%);
|
86
182
|
$return : map-merge($return, s-translate(0 -50%));
|
87
183
|
} @else if $align == center {
|
88
184
|
$return : map-set($return, left, 50%);
|
89
185
|
$return : map-merge($return, s-translate(-50% -50%));
|
90
186
|
} @else if $align == right {
|
91
|
-
$return : map-set($return, right, 0);
|
187
|
+
$return : map-set($return, right, 0%);
|
92
188
|
$return : map-merge($return, s-translate(0 -50%));
|
93
189
|
} @else {
|
94
|
-
$return : map-merge($return, s-translate(-50% 0));
|
190
|
+
$return : map-merge($return, s-translate(-50% 0%));
|
95
191
|
}
|
96
192
|
} @else if $vertical-align == bottom {
|
97
|
-
$return : map-set($return, bottom, 0);
|
193
|
+
$return : map-set($return, bottom, 0%);
|
98
194
|
@if $align == left {
|
99
|
-
$return : map-set($return, left, 0);
|
195
|
+
$return : map-set($return, left, 0%);
|
100
196
|
} @else if $align == center {
|
101
197
|
$return : map-set($return, left, 50%);
|
102
|
-
$return : map-merge($return, s-translate(-50% 0));
|
198
|
+
$return : map-merge($return, s-translate(-50% 0%));
|
103
199
|
} @else if $align == right {
|
104
|
-
$return : map-set($return, right, 0);
|
200
|
+
$return : map-set($return, right, 0%);
|
105
201
|
} @else {
|
106
|
-
$return : map-set($return, left, 0);
|
202
|
+
$return : map-set($return, left, 0%);
|
107
203
|
}
|
108
204
|
} @else if $align == left {
|
109
|
-
$return : map-set($return, left, 0);
|
205
|
+
$return : map-set($return, left, 0%);
|
110
206
|
@if $vertical-align == top {
|
111
|
-
$return : map-set($return, top, 0);
|
207
|
+
$return : map-set($return, top, 0%);
|
112
208
|
} @else if $vertical-align == middle {
|
113
209
|
$return : map-set($return, top, 50%);
|
114
210
|
$return : map-merge($return, s-translate(0 -50%));
|
115
211
|
} @else if $vertical-align == bottom {
|
116
|
-
$return : map-set($return, bottom, 0);
|
212
|
+
$return : map-set($return, bottom, 0%);
|
117
213
|
} @else {
|
118
|
-
$return : map-set($return, top, 0);
|
214
|
+
$return : map-set($return, top, 0%);
|
119
215
|
}
|
120
216
|
} @else if $align == center {
|
121
217
|
$return : map-set($return, left, 50%);
|
122
218
|
@if $vertical-align == top {
|
123
|
-
$return : map-set($return, top, 0);
|
124
|
-
$return : map-merge($return, s-translate(-50% 0));
|
219
|
+
$return : map-set($return, top, 0%);
|
220
|
+
$return : map-merge($return, s-translate(-50% 0%));
|
125
221
|
} @else if $vertical-align == middle {
|
126
222
|
$return : map-set($return, top, 50%);
|
127
223
|
$return : map-merge($return, s-translate(-50% -50%));
|
128
224
|
} @else if $vertical-align == bottom {
|
129
|
-
$return : map-set($return, bottom, 0);
|
130
|
-
$return : map-merge($return, s-translate(-50% 0));
|
225
|
+
$return : map-set($return, bottom, 0%);
|
226
|
+
$return : map-merge($return, s-translate(-50% 0%));
|
131
227
|
} @else {
|
132
|
-
$return : map-set($return, top, 0);
|
228
|
+
$return : map-set($return, top, 0%);
|
133
229
|
}
|
134
230
|
} @else if $align == right {
|
135
|
-
$return : map-set($return, right, 0);
|
231
|
+
$return : map-set($return, right, 0%);
|
136
232
|
@if $vertical-align == top {
|
137
|
-
$return : map-set($return, top, 0);
|
233
|
+
$return : map-set($return, top, 0%);
|
138
234
|
} @else if $vertical-align == middle {
|
139
235
|
$return : map-set($return, top, 50%);
|
140
236
|
$return : map-merge($return, s-translate(0 -50%));
|
141
237
|
} @else if $vertical-align == bottom {
|
142
|
-
$return : map-set($return, bottom, 0);
|
238
|
+
$return : map-set($return, bottom, 0%);
|
143
239
|
} @else {
|
144
|
-
$return : map-set($return, top, 0);
|
240
|
+
$return : map-set($return, top, 0%);
|
145
241
|
}
|
146
242
|
}
|
147
243
|
}
|
@@ -162,6 +258,24 @@
|
|
162
258
|
@return $return;
|
163
259
|
}
|
164
260
|
|
261
|
+
//
|
262
|
+
// Vertical aligner
|
263
|
+
//
|
264
|
+
@mixin s-vertical-aligner(
|
265
|
+
) {
|
266
|
+
&:before {
|
267
|
+
content: '';
|
268
|
+
display: inline-block;
|
269
|
+
vertical-align: middle;
|
270
|
+
height: 100%; width: .1px;
|
271
|
+
}
|
272
|
+
|
273
|
+
> * {
|
274
|
+
display: inline-block;
|
275
|
+
vertical-align: middle;
|
276
|
+
}
|
277
|
+
}
|
278
|
+
|
165
279
|
//
|
166
280
|
// Translate
|
167
281
|
//
|
@@ -1,8 +1,38 @@
|
|
1
|
-
//
|
2
|
-
//
|
3
|
-
//
|
4
|
-
//
|
5
|
-
//
|
1
|
+
// |------------------------------------------------------
|
2
|
+
// |------------------------------------------------------
|
3
|
+
// Sugar (.scss)
|
4
|
+
// Writing SCSS has never tasted better!
|
5
|
+
// |------------------------------------------------------
|
6
|
+
// |------------------------------------------------------
|
7
|
+
|
8
|
+
// |------------------------------------------------------
|
9
|
+
// |------------------------------------------------------
|
10
|
+
// Copyright (c) 2015 Olivier Bossel
|
11
|
+
|
12
|
+
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
13
|
+
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
14
|
+
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
15
|
+
// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
// The above copyright notice and this permission notice shall be included in all copies or substantial portions
|
18
|
+
// of the Software.
|
19
|
+
|
20
|
+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
21
|
+
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
22
|
+
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
23
|
+
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
24
|
+
// IN THE SOFTWARE.
|
25
|
+
// |------------------------------------------------------
|
26
|
+
// |------------------------------------------------------
|
27
|
+
|
28
|
+
// |------------------------------------------------------
|
29
|
+
// |------------------------------------------------------
|
30
|
+
// @created 20.11.15
|
31
|
+
// @updated 23.11.15
|
32
|
+
// @author Olivier Bossel <olivier.bossel@gmail.com>
|
33
|
+
// @version 1.0.1
|
34
|
+
// |------------------------------------------------------
|
35
|
+
// |------------------------------------------------------
|
6
36
|
|
7
37
|
//
|
8
38
|
// Vendors
|
@@ -521,6 +551,15 @@ $_sugar-inited : false;
|
|
521
551
|
}
|
522
552
|
$font-family : sugar('settings.typo.font-family');
|
523
553
|
@if $font-family {
|
554
|
+
// try to get the font family from fonts
|
555
|
+
$fonts : sugar('settings.fonts');
|
556
|
+
$f : map-get($fonts, $font-family);
|
557
|
+
@if $f {
|
558
|
+
$ff : map-get($f, font-family);
|
559
|
+
@if $ff {
|
560
|
+
$font-family : $ff;
|
561
|
+
}
|
562
|
+
}
|
524
563
|
font-family: $font-family;
|
525
564
|
}
|
526
565
|
}
|
@@ -293,6 +293,12 @@ $_s-font-aliases : (
|
|
293
293
|
$f : map-get($fonts, $font-family);
|
294
294
|
$cap-height : map-get-or($f, cap-height, 0);
|
295
295
|
$font-family : map-get-or($f, font-family, $font-family);
|
296
|
+
@if not $font-style {
|
297
|
+
$font-style : map-get($f, font-style);
|
298
|
+
}
|
299
|
+
@if not $font-weight {
|
300
|
+
$font-weight : map-get($f, font-weight);
|
301
|
+
}
|
296
302
|
}
|
297
303
|
}
|
298
304
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Bossel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|