jeet 0.0.4 → 0.0.5

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: 437db5eee7b7e979b2fb68cd0507d1d8af434038
4
- data.tar.gz: 5e57de4d96437802c67895a81745b7acc5db2d51
3
+ metadata.gz: 26af6d0b1c45176d1e75d28f4593d7e6613fbf08
4
+ data.tar.gz: 98954cffa8660fa9f24d4e91203f2cb6a59badcb
5
5
  SHA512:
6
- metadata.gz: b8a59c212635e799d9f3c4b84fe28ebf911faa79a003828983c5514c586b1b625721d85799c074f6e9e0a5532ed8a0a46ff2ad9e4bb167cbd1747063b47f0f0d
7
- data.tar.gz: 44e0e00352194c767da769f0c796ca60023e96cbc92e69d3583ffe1e92459298e525a46f155d0a9da1ad96447a4c82a942101b2eeff5de68d68f84a12f246924
6
+ metadata.gz: ce81c976a712a87fa0630d7b4655fdcdbd8bdd57e0f15c710b403ddc366d0077edadb08b824c84500cf79ccd15b1101af278c52150a64ad0f90db2b96a159c9b
7
+ data.tar.gz: 5ee0eb6b4deb0faeb2562abc3b8e0d7f7c304b74b69515b8effe16e6e7fe7b91b5c3d0c679e27d416b5f359d87077b4ad8a41b013ade4ad00b5ca4272c63220d
@@ -0,0 +1,23 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .inch
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ test/tmp
17
+ test/version_tmp
18
+ tmp
19
+ *.bundle
20
+ *.so
21
+ *.o
22
+ *.a
23
+ mkmf.log
@@ -0,0 +1,7 @@
1
+ # Jeet Changelog
2
+
3
+ ## 0.0.5
4
+
5
+ Released Sep 6, 2014 ([0.0.5](https://github.com/corysimmons/jeet-rails/tree/v0.0.5)).
6
+
7
+ * Initial Re-release.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in jeet.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Cory Simmons
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,34 @@
1
+ # Jeet-Rails
2
+ SCSS Jeet for Rails
3
+
4
+ ## Installation
5
+
6
+ In your Gemfile:
7
+
8
+ ```ruby
9
+ gem 'jeet'
10
+ ```
11
+
12
+ And then execute:
13
+
14
+ ```bash
15
+ bundle install
16
+ ```
17
+
18
+ In your main stylesheet:
19
+
20
+ ```sass
21
+ @import 'jeet';
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ TODO: Write usage instructions here
27
+
28
+ ## Contributing
29
+
30
+ 1. Fork it ( https://github.com/corysimmons/jeet/fork )
31
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
32
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
33
+ 4. Push to the branch (`git push origin my-new-feature`)
34
+ 5. Create a new Pull Request
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,25 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jeet/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'jeet'
8
+ spec.version = Jeet::VERSION
9
+ spec.authors = ['Cory Simmons', 'Jonah Ruiz']
10
+ spec.email = ['csimmonswork@gmail.com', 'jonah@pixelhipsters.com']
11
+ spec.summary = 'A grid system for humans.'
12
+ spec.description = 'The most advanced and intuitive Sass grid system on the planet.'
13
+ spec.homepage = 'http://jeet.gs'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'sass', '~> 3.2'
22
+
23
+ spec.add_development_dependency 'bundler', '~> 1.6'
24
+ spec.add_development_dependency 'rake', '~> 10.0'
25
+ end
@@ -1,4 +1,6 @@
1
- require 'compass'
2
- require 'breakpoint'
3
- extension_path = File.expand_path(File.join(File.dirname(__FILE__), ".."))
4
- Compass::Frameworks.register('jeet', :path => extension_path)
1
+ require "jeet/version"
2
+
3
+ module Jeet
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module Jeet
2
+ VERSION = '0.0.5'
3
+ end
@@ -0,0 +1,17 @@
1
+ /* Syntax Quick Reference
2
+ --------------------------
3
+ column($ratios: 1, $offset: 0, $cycle: 0, $uncycle: 0, $gutter: $jeet-gutter)
4
+ span($ratio: 1, $offset: 0)
5
+ shift($ratios: 0, $col_or_span: column, $gutter: $jeet-gutter)
6
+ unshift()
7
+ edit()
8
+ center($max_width: 1410px, $pad: 0)
9
+ stack($pad: 0, $align: false)
10
+ unstack()
11
+ align($direction: both)
12
+ cf()
13
+ */
14
+
15
+ @import 'jeet/_settings';
16
+ @import 'jeet/_functions';
17
+ @import 'jeet/_grid';
@@ -0,0 +1,120 @@
1
+ /**
2
+ * List functions courtesy of the wonderful folks at Team Sass.
3
+ * Check out their awesome grid: Singularity.
4
+ */
5
+
6
+ /**
7
+ * Get percentage from a given ratio.
8
+ * @param {number} [$ratio=1] - The column ratio of the element.
9
+ * @returns {number} - The percentage value.
10
+ */
11
+ @function jeet-get-span($ratio: 1) {
12
+ @return $ratio * 100;
13
+ }
14
+
15
+ /**
16
+ * Work out the column widths based on the ratio and gutter sizes.
17
+ * @param {number} [$ratios=1] - The column ratio of the element.
18
+ * @param {number} [$gutter=$jeet-gutter] - The gutter for the column.
19
+ * @returns {list} $width $gutter - A list containing the with and gutter for the element.
20
+ */
21
+ @function jeet-get-column($ratios: 1, $gutter: $jeet-gutter) {
22
+ $ratios: if(not $jeet-parent-first, jeet-reverse($ratios), $ratios);
23
+ $width: 100;
24
+
25
+ @each $ratio in $ratios {
26
+ $gutter: $gutter / $width * 100;
27
+ $width: 100 * $ratio - $gutter + $ratio * $gutter;
28
+ }
29
+
30
+ @return $width $gutter;
31
+ }
32
+
33
+ /**
34
+ * Get the set layout direction for the project.
35
+ * @returns {string} $direction - The layout direction.
36
+ */
37
+ @function jeet-get-layout-direction() {
38
+ $direction: if($jeet-layout-direction == "RTL", right, left);
39
+
40
+ @return $direction;
41
+ }
42
+
43
+ /**
44
+ * Replace a specified list value with a new value (uses built in set-nth() if available)
45
+ * @param {list} $list - The list of values you want to alter.
46
+ * @param {number} $index - The index of the list item you want to replace.
47
+ * @param {*} $value - The value you want to replace $index with.
48
+ * @returns {list} $list - The list with the value replaced or removed.
49
+ * @warn if an invalid index is supplied.
50
+ */
51
+ @function jeet-replace-nth($list, $index, $value) {
52
+ // Fallback for Sass 3.2
53
+ @if function-exists("set-nth") != true {
54
+ $result: ();
55
+ $index: if($index < 0, length($list) + $index + 1, $index);
56
+
57
+ @for $i from 1 through length($list) {
58
+ $result: append($result, if($i == $index, $value, nth($list, $i)));
59
+ }
60
+
61
+ @return $result;
62
+ }
63
+
64
+ // Sass 3.3
65
+ $result: set-nth($list, $index, $value);
66
+
67
+ @return $result;
68
+ }
69
+
70
+ /**
71
+ * Reverse a list (progressively enhanced for Sass 3.3)
72
+ * @param {list} $list - The list of values you want to reverse.
73
+ * @returns {list} $result - The reversed list.
74
+ */
75
+ @function jeet-reverse($list) {
76
+ // Sass 3.2
77
+ @if function-exists("set-nth") != true {
78
+ $result: ();
79
+
80
+ @for $i from length($list) * -1 through -1 {
81
+ $result: append($result, nth($list, abs($i)));
82
+ }
83
+
84
+ @return $result;
85
+ }
86
+
87
+ // Sass 3.3
88
+ @for $i from 1 through floor(length($list) / 2) + 1 {
89
+ $tmp: nth($list, $i);
90
+ $list: set-nth($list, $i, nth($list, -$i));
91
+ $list: set-nth($list, -$i, $tmp);
92
+ }
93
+
94
+ @return $list;
95
+ }
96
+
97
+ /**
98
+ * Get the opposite direction to a given value.
99
+ * @param {string} $dir - The direction you want the opposite of.
100
+ * @returns {string} - The opposite direction to $dir.
101
+ * @warn if an incorrect string is provided.
102
+ */
103
+ @function jeet-opposite-direction($direction) {
104
+ @if $direction == "left" {
105
+ @return right;
106
+ } @else if $direction == "right" {
107
+ @return left;
108
+ } @else if $direction == "top" {
109
+ @return bottom;
110
+ } @else if $direction == "bottom" {
111
+ @return top;
112
+ } @else if index("ltr" "LTR", $direction) {
113
+ @return rtl;
114
+ } @else if index("rtl" "RTL", $direction) {
115
+ @return ltr;
116
+ } @else {
117
+ @warn "`#{$direction}` is not a direction; please make sure your direction is all lowercase.";
118
+ @return false;
119
+ }
120
+ }
@@ -0,0 +1,289 @@
1
+ /**
2
+ * Style an element as a column with a gutter.
3
+ * @param {number} [$ratios=1] - A width relative to its container as a fraction.
4
+ * @param {number} [$offset=0] - A offset specified as a fraction (see $ratios).
5
+ * @param {number} [$cycle=0] - Easily create an nth column grid where $cycle equals the number of columns.
6
+ * @param {number} [$uncycle=0] - Undo a previous cycle vlue to allow for a new one.
7
+ * @param {number} [$gutter=$jeet-gutter] - Specifiy the gutter width as a percentage of the containers width.
8
+ */
9
+ @mixin column($ratios: 1, $offset: 0, $cycle: 0, $uncycle: 0, $gutter: $jeet-gutter) {
10
+ $side: jeet-get-layout-direction();
11
+ $opposite-side: jeet-opposite-direction($side);
12
+ $column-widths: jeet-get-column($ratios, $gutter);
13
+ $margin-last: 0;
14
+ $margin-l: $margin-last;
15
+ $margin-r: nth($column-widths, 2);
16
+
17
+ @if $offset != 0 {
18
+ @if $offset < 0 {
19
+ $offset: $offset * -1;
20
+ $offset: nth(jeet-get-column($offset, nth($column-widths, 2)), 1);
21
+ $margin-last: $offset + nth($column-widths, 2) * 2;
22
+ $margin-r: $margin-last;
23
+ } @else {
24
+ $offset: nth(jeet-get-column($offset, nth($column-widths, 2)), 1);
25
+ $margin-l: $offset + nth($column-widths, 2);
26
+ }
27
+ }
28
+
29
+ @include cf;
30
+ float: $side;
31
+ clear: none;
32
+ text-align: inherit;
33
+ width: nth($column-widths, 1) * 1%;
34
+ margin: {
35
+ #{$side}: $margin-l * 1%;
36
+ #{$opposite-side}: $margin-r * 1%;
37
+ };
38
+
39
+ @if $uncycle != 0 {
40
+ &:nth-child(#{$uncycle}n) {
41
+ margin-#{jeet-opposite-direction($side)}: $margin-r * 1%;
42
+ float: $side;
43
+ }
44
+ &:nth-child(#{$uncycle}n + 1) {
45
+ clear: none;
46
+ }
47
+ }
48
+
49
+ @if $cycle != 0 {
50
+ &:nth-child(#{$cycle}n) {
51
+ margin-#{jeet-opposite-direction($side)}: $margin-last * 1%;
52
+ float: jeet-opposite-direction($side);
53
+ }
54
+ &:nth-child(#{$cycle}n + 1) {
55
+ clear: both;
56
+ }
57
+ } @else {
58
+ &:last-child {
59
+ margin-#{jeet-opposite-direction($side)}: $margin-last * 1%;
60
+ }
61
+ }
62
+ }
63
+
64
+ /**
65
+ * An alias for the column mixin.
66
+ * @param [$args...] - All arguments get passed through to column().
67
+ */
68
+ @mixin col($args...) {
69
+ @include column($args...);
70
+ }
71
+
72
+ /**
73
+ * Style an element as a column without any gutters for a seamless row.
74
+ * @param {number} [$ratios=1] - A width relative to its container as a fraction.
75
+ * @param {number} [$offset=0] - A offset specified as a fraction (see $ratios).
76
+ */
77
+ @mixin span($ratio: 1, $offset: 0) {
78
+ $side: jeet-get-layout-direction();
79
+ $opposite-side: jeet-opposite-direction($side);
80
+ $span-width: jeet-get-span($ratio);
81
+ $margin-r: 0;
82
+ $margin-l: $margin-r;
83
+ @if $offset != 0 {
84
+ @if $offset < 0 {
85
+ $offset: $offset * -1;
86
+ $margin-r: jeet-get-span($offset);
87
+ } @else {
88
+ $margin-l: jeet-get-span($offset);
89
+ }
90
+ }
91
+
92
+ @include cf;
93
+ float: $side;
94
+ clear: none;
95
+ text-align: inherit;
96
+ width: $span-width * 1%;
97
+ margin: {
98
+ #{$side}: $margin-l * 1%;
99
+ #{$opposite-side}: $margin-r * 1%;
100
+ };
101
+ }
102
+
103
+ /**
104
+ * Reorder columns without altering the HTML.
105
+ * @param {number} [$ratios=0] - Specify how far along you want the element to move.
106
+ * @param {string} [$col-or-span=column] - Specify whether the element has a gutter or not.
107
+ * @param {number} [$gutter=$jeet-gutter] - Specifiy the gutter width as a percentage of the containers width.
108
+ */
109
+ @mixin shift($ratios: 0, $col-or-span: column, $gutter: $jeet-gutter) {
110
+ $translate: '';
111
+ $side: jeet-get-layout-direction();
112
+
113
+ @if $side == right {
114
+ $ratios: jeet-replace-nth($ratios, 0, nth($ratios, 1) * -1);
115
+ }
116
+
117
+ @if index("column" "col" "c", $col-or-span) {
118
+ $column-widths: jeet-get-column($ratios, $gutter);
119
+ $translate: nth($column-widths, 1) + nth($column-widths, 2);
120
+ } @else {
121
+ $translate: jeet-get-span($ratios);
122
+ }
123
+
124
+ position: relative;
125
+ left: $translate * 1%;
126
+ }
127
+
128
+ /**
129
+ * Reset an element that has had shift() applied to it.
130
+ */
131
+ @mixin unshift() {
132
+ position: static;
133
+ left: 0;
134
+ }
135
+
136
+ /**
137
+ * View the grid and its layers for easy debugging.
138
+ */
139
+ @mixin edit() {
140
+ * {
141
+ background: rgba(0, 0, 0, .05);
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Alias for edit().
147
+ */
148
+ @mixin debug() {
149
+ @include edit;
150
+ }
151
+
152
+ /**
153
+ * Horizontally center an element.
154
+ * @param {number} [$max-width=1410px] - The max width the element can be.
155
+ * @param {number} [$pad=0] - Specify the element's left and right padding.
156
+ */
157
+ @mixin center($max-width: $jeet-max-width, $pad: 0) {
158
+ @include cf;
159
+ width: auto;
160
+ max-width: $max-width;
161
+ float: none;
162
+ display: block;
163
+ margin: {
164
+ right: auto;
165
+ left: auto;
166
+ };
167
+ padding: {
168
+ left: $pad;
169
+ right: $pad;
170
+ };
171
+ }
172
+
173
+ /**
174
+ * Uncenter an element.
175
+ */
176
+ @mixin uncenter() {
177
+ max-width: none;
178
+ margin-right: 0;
179
+ margin-left: 0;
180
+ padding-left: 0;
181
+ padding-right: 0;
182
+ }
183
+
184
+ /**
185
+ * Stack an element so that nothing is either side of it.
186
+ * @param {number} [$pad=0] - Specify the element's left and right padding.
187
+ * @param {boolean/string} [$align=false] - Specify the text align for the element.
188
+ */
189
+ @mixin stack($pad: 0, $align: false) {
190
+ $side: jeet-get-layout-direction();
191
+ $opposite-side: jeet-opposite-direction($side);
192
+
193
+ display: block;
194
+ clear: both;
195
+ float: none;
196
+ width: 100%;
197
+ margin: {
198
+ left: auto;
199
+ right: auto;
200
+ };
201
+
202
+ &:first-child {
203
+ margin-#{$side}: auto;
204
+ }
205
+
206
+ &:last-child {
207
+ margin-#{$opposite-side}: auto;
208
+ }
209
+
210
+ @if $pad != 0 {
211
+ padding: {
212
+ left: $pad;
213
+ right: $pad;
214
+ }
215
+ }
216
+
217
+ @if ($align is not false) {
218
+ @if index("center" "c", $align) {
219
+ text-align: center;
220
+ } @else if index("left" "l", $align) {
221
+ text-align: left;
222
+ } @else if index("right" "r", $align) {
223
+ text-align: right;
224
+ }
225
+ }
226
+ }
227
+
228
+ /**
229
+ * Unstack an element.
230
+ */
231
+ @mixin unstack() {
232
+ $side: jeet-get-layout-direction();
233
+ $opposite-side: jeet-opposite-direction($side);
234
+
235
+ text-align: $side;
236
+ display: inline;
237
+ clear: none;
238
+ width: auto;
239
+ margin: {
240
+ left: 0;
241
+ right: 0;
242
+ };
243
+
244
+ &:first-child {
245
+ margin-#{$side}: 0;
246
+ }
247
+
248
+ &:last-child {
249
+ margin-#{jeet-opposite-direction($side)}: 0;
250
+ }
251
+ }
252
+
253
+ /**
254
+ * Center an element on either or both axes.
255
+ * @requires A parent container with relative positioning.
256
+ * @param {string} [$direction=both] - Specify which axes to center the element on.
257
+ */
258
+ @mixin align($direction: both) {
259
+ position: absolute;
260
+ transform-style: preserve-3d;
261
+
262
+ @if index("horizontal" "h", $direction) {
263
+ left: 50%;
264
+ transform: translateX(-50%);
265
+ } @else if index("vertical" "v", $direction) {
266
+ top: 50%;
267
+ transform: translateY(-50%);
268
+ } @else {
269
+ top: 50%;
270
+ left: 50%;
271
+ transform: translate(-50%, -50%);
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Apply a clearfix to an element.
277
+ */
278
+ @mixin cf() {
279
+ *zoom: 1;
280
+
281
+ &:before, &:after {
282
+ content: '';
283
+ display: table;
284
+ }
285
+
286
+ &:after {
287
+ clear: both;
288
+ }
289
+ }