stitch 0.1.7.beta.2 → 0.1.7.beta.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Stitch
2
- VERSION = "0.1.7.beta.2"
2
+ VERSION = "0.1.7.beta.3"
3
3
  end
@@ -1,35 +1,168 @@
1
+ // Generate inline class names for your elements
2
+ //
3
+ // <div class="actions inset-vert-small-large">
4
+ // <button type="submit">Totes click me!</button>
5
+ // </div>
6
+ //
7
+ // Padding
8
+ // ---------------
9
+ // pad-{item} : pad-small (padding: 10px)
10
+ // pad-vert-{item}-{item + 1} : pad-vert-small-large (padding: 10px 0 40px 0)
11
+ // pad-horz-{item}-{item + 1} : pad-horz-small-large (padding: 0 10px 0 40px)
12
+ //
13
+ // Margin
14
+ // ---------------
15
+ // inset-{item} : inset-small (margin: 10px)
16
+ // inset-vert-{item}-{item + 1} : inset-vert-small-large (margin: 10px 0 40px 0)
17
+ // inset-horz-{item}-{item + 1} : inset-horz-small-large (margin: 0 10px 0 40px)
18
+ //
19
+ // Offset margin
20
+ // ---------------
21
+ // offset-{item} : offset-small (margin: -10px)
22
+ // offset-vert-{item}-{item + 1} : offset-vert-small-large (margin: -10px 0 -40px 0)
23
+ // offset-horz-{item}-{item + 1} : offset-horz-small-large (margin: 0 -10px 0 -40px)
24
+
1
25
  @mixin spacing-classes($base: 10px, $list: small normal medium large){
2
-
26
+
3
27
  @for $i from 1 through length($list) {
4
-
5
- .padding-#{nth(unquote($list), $i)} {
28
+
29
+ .pad-#{nth(unquote($list), $i)} {
6
30
  padding: ($base * $i);
7
31
  }
32
+
33
+ .inset-#{nth(unquote($list), $i)} {
34
+ margin: ($base * $i);
35
+ }
36
+
37
+ .offset-#{nth(unquote($list), $i)} {
38
+ margin: (-($base * $i));
39
+ }
8
40
 
9
- .padding-vertical-#{nth(unquote($list), $i)} {
41
+ .pad-top-#{nth(unquote($list), $i)} {
10
42
  padding-top: ($base * $i);
11
- padding-bottom: ($base * $i);
12
43
  }
13
-
14
- .padding-horizontal-#{nth(unquote($list), $i)} {
44
+
45
+ .pad-right-#{nth(unquote($list), $i)} {
15
46
  padding-right: ($base * $i);
47
+ }
48
+
49
+ .pad-bottom-#{nth(unquote($list), $i)} {
50
+ padding-bottom: ($base * $i);
51
+ }
52
+
53
+ .pad-left-#{nth(unquote($list), $i)} {
16
54
  padding-left: ($base * $i);
17
55
  }
18
56
 
19
- .margin-#{nth(unquote($list), $i)} {
57
+ .inset-top-#{nth(unquote($list), $i)} {
58
+ margin-top: ($base * $i);
59
+ }
60
+
61
+ .inset-right-#{nth(unquote($list), $i)} {
62
+ margin-right: ($base * $i);
63
+ }
64
+
65
+ .inset-bottom-#{nth(unquote($list), $i)} {
66
+ margin-bottom: ($base * $i);
67
+ }
68
+
69
+ .inset-left-#{nth(unquote($list), $i)} {
70
+ margin-left: ($base * $i);
71
+ }
72
+
73
+ .outset-top-#{nth(unquote($list), $i)} {
74
+ margin-top: (-($base * $i));
75
+ }
76
+
77
+ .outset-right-#{nth(unquote($list), $i)} {
78
+ margin-right: (-($base * $i));
79
+ }
80
+
81
+ .outset-bottom-#{nth(unquote($list), $i)} {
82
+ margin-bottom: (-($base * $i));
83
+ }
84
+
85
+ .outset-left-#{nth(unquote($list), $i)} {
86
+ margin-left: (-($base * $i));
87
+ }
88
+
89
+ .inset-#{nth(unquote($list), $i)} {
20
90
  margin: ($base * $i);
21
91
  }
92
+
93
+ .offset-#{nth(unquote($list), $i)} {
94
+ margin: (-($base * $i));
95
+ }
22
96
 
23
- .margin-vertical-#{nth(unquote($list), $i)} {
97
+ .pad-vert-#{nth(unquote($list), $i)} {
98
+ padding-top: ($base * $i);
99
+ padding-bottom: ($base * $i);
100
+ }
101
+
102
+ .pad-horz-#{nth(unquote($list), $i)} {
103
+ padding-right: ($base * $i);
104
+ padding-left: ($base * $i);
105
+ }
106
+
107
+ .inset-vert-#{nth(unquote($list), $i)} {
24
108
  margin-top: ($base * $i);
25
109
  margin-bottom: ($base * $i);
26
110
  }
27
-
28
- .margin-horizontal-#{nth(unquote($list), $i)} {
111
+
112
+ .inset-horz-#{nth(unquote($list), $i)} {
29
113
  margin-right: ($base * $i);
30
114
  margin-left: ($base * $i);
31
115
  }
116
+
117
+ .offset-vert-#{nth(unquote($list), $i)} {
118
+ margin-top: (-($base * $i));
119
+ margin-bottom: (-($base * $i));
120
+ }
121
+
122
+ .offset-horz-#{nth(unquote($list), $i)} {
123
+ margin-right: (-($base * $i));
124
+ margin-left: (-($base * $i));
125
+ }
126
+
127
+ @for $j from 1 through length($list) {
128
+
129
+ @if ($i != $j) {
130
+
131
+ .pad-vert-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
132
+ padding-top: ($base * $i);
133
+ padding-bottom: ($base * $j);
134
+ }
135
+
136
+ .pad-horz-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
137
+ padding-right: ($base * $i);
138
+ padding-left: ($base * $j);
139
+ }
140
+
141
+ .inset-vert-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
142
+ margin-top: ($base * $i);
143
+ margin-bottom: ($base * $j);
144
+ }
145
+
146
+ .inset-horz-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
147
+ margin-right: ($base * $i);
148
+ margin-left: ($base * $j);
149
+ }
150
+
151
+ .offset-vert-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
152
+ margin-top: (-($base * $i));
153
+ margin-bottom: (-($base * $j));
154
+ }
155
+
156
+ .offset-horz-#{nth(unquote($list), $i)}-#{nth(unquote($list), ($j))} {
157
+ margin-right: (-($base * $i));
158
+ margin-left: (-($base * $j));
159
+ }
160
+ }
161
+ }
32
162
  }
33
163
  }
34
164
 
35
- //@include spacing-classes(20px, $list: "big" "bigger" "biggerer" "biggest" );
165
+ // @include spacing-classes();
166
+ // @include spacing-classes($base: 5px);
167
+ // @include spacing-classes($base: 5px, $list: big bigger biggerer evenbiggerer biggest);
168
+ // @include spacing-classes($list: big bigger biggerer evenbiggerer biggest);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stitch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7.beta.2
4
+ version: 0.1.7.beta.3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-23 00:00:00.000000000 Z
12
+ date: 2012-08-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sass