para-grids 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +125 -0
- data/Rakefile +1 -0
- data/lib/para/version.rb +3 -0
- data/lib/para.rb +7 -0
- data/para.gemspec +23 -0
- data/stylesheets/.DS_Store +0 -0
- data/stylesheets/_para.scss +6 -0
- data/stylesheets/para/_functions.scss +4 -0
- data/stylesheets/para/_grids.scss +19 -0
- data/stylesheets/para/_media.scss +5 -0
- data/stylesheets/para/_push-pull.scss +74 -0
- data/stylesheets/para/_settings.scss +10 -0
- data/stylesheets/para/_widths.scss +34 -0
- metadata +90 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 10c079ed0f3d33a900a9bcd2ef2b9ba4859eb4a7
|
4
|
+
data.tar.gz: 06a921beb2d8d1fa1db151e839bfa46014835baa
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8416958f943c7546469c856eb59c143bbbdf37dd7dc1476a74bc3b60e5f691430235ac0a580cc8937bc51c400700ee61904d51403bbd271001c423468c389ea5
|
7
|
+
data.tar.gz: 2bd3901c4d865ffe4aba0e5b8eb1c4afddac493e9608faa299a6b5a2ae220d56edc49728b04a1e0599a815131e3d8d8b9536e1196b83a1bd2e3663b60125de71
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Ian Thomas
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,125 @@
|
|
1
|
+
# Para
|
2
|
+
|
3
|
+
> ORIGIN from Greek para ‘beside’;
|
4
|
+
|
5
|
+
Para is a simple grid system developed for use internally at [finn](http://www.finncomms.com) and borrows heavily from the thinking of our good friend [@csswizardry](http://www.twitter.com/csswizardy) creator of [inuit css](www.github.com/csswizardy/inuit.css) and [csswizardry-grids](http://www.github.com/csswizardry/csswizardry-grids).
|
6
|
+
|
7
|
+
Para adds basic grids to your project as a compass extension.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'para-grids'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install para
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Setting up a grid using the defaults is as simple as
|
26
|
+
|
27
|
+
```sass
|
28
|
+
@import "compass";
|
29
|
+
@import "para";
|
30
|
+
|
31
|
+
@include initialise-grid(); //we are English!
|
32
|
+
|
33
|
+
@inlude setup-grid();
|
34
|
+
```
|
35
|
+
|
36
|
+
### Getting Responsive
|
37
|
+
|
38
|
+
Para includes features to help make your grids respond to device widths and you can set them up as follows
|
39
|
+
|
40
|
+
```sass
|
41
|
+
@import "compass";
|
42
|
+
@import "para";
|
43
|
+
|
44
|
+
@include initialise-grid();
|
45
|
+
|
46
|
+
@include setup-grid();
|
47
|
+
$tablet: '(min-width: 500px)';
|
48
|
+
|
49
|
+
@include media-query($tablet){
|
50
|
+
@include setup-grid('tablet-');
|
51
|
+
}
|
52
|
+
```
|
53
|
+
|
54
|
+
Of course, there are neater ways of doing this, and we favour the following:
|
55
|
+
|
56
|
+
```sass
|
57
|
+
@import "compass";
|
58
|
+
@import "para";
|
59
|
+
|
60
|
+
$breakpoints: palm, tablet, portable, desk, wide, huge;
|
61
|
+
$vars: $palm, $tablet, $portable, $desk, $wide, $huge;
|
62
|
+
|
63
|
+
@for $i from 1 through length($breakpoints){
|
64
|
+
@include media-query(#{nth($vars, $i)}){
|
65
|
+
@include setup-grid("#{nth($breakpoints, $i)-"});
|
66
|
+
}
|
67
|
+
}
|
68
|
+
```
|
69
|
+
|
70
|
+
We define the breakpoints above for you as defaults, but you can set them to be whatever you like.
|
71
|
+
|
72
|
+
### In your html
|
73
|
+
|
74
|
+
To use the grids that para spits out, simply scaffold as follows:
|
75
|
+
|
76
|
+
```html
|
77
|
+
<div class="grid">
|
78
|
+
<div class="grid__item one-third">Column 1</div>
|
79
|
+
<div class="grid__item two-thirds">Column 2</div>
|
80
|
+
</div>
|
81
|
+
```
|
82
|
+
|
83
|
+
When you run `setup-grid()` what you are actually doing is creating a namespaced set of widths that can be used as secondary classes to define column sizes. Sounds complicated, but it's very simple.
|
84
|
+
|
85
|
+
Currently para supports columns up to `eigths` but more may well be added in the future.
|
86
|
+
|
87
|
+
To use a namespaced grid such as those created in the second responsive example above, simply work from mobile outwards and use the namespaced classes to size as you want.
|
88
|
+
|
89
|
+
```html
|
90
|
+
<div class="grid">
|
91
|
+
<div class="grid__item one-whole portable-one-third">...</div>
|
92
|
+
<div class="grid__item one-whole portable-two-thirds">...</div>
|
93
|
+
</div>
|
94
|
+
```
|
95
|
+
|
96
|
+
### Pushing and Pulling
|
97
|
+
|
98
|
+
Para also includes the ability to create push- and pull- classes for your namespaced grid widths. It's as simple as adding:
|
99
|
+
|
100
|
+
```sass
|
101
|
+
@include setup-push-pull();
|
102
|
+
```
|
103
|
+
|
104
|
+
You can include a namespace inside the mixin to achieve classes that match your namespaced grid widths (e.g. `@include setup-push-pull('palm-');`).
|
105
|
+
|
106
|
+
Using these classes follows the same BEM format as the grid widths:
|
107
|
+
|
108
|
+
```html
|
109
|
+
<div class="grid">
|
110
|
+
<div class="grid__item one-third push-two-thirds">...</div>
|
111
|
+
<div class="grid__item two-thirds pull_one-third">...</div>
|
112
|
+
</div>
|
113
|
+
```
|
114
|
+
|
115
|
+
## Contributing
|
116
|
+
|
117
|
+
1. Fork it
|
118
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
119
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
120
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
121
|
+
5. Create new Pull Request
|
122
|
+
|
123
|
+
## Big Thanks
|
124
|
+
|
125
|
+
Once again, big thanks to Harry for his awesome work that has been a big influence on this project. [Check him out](http://www.csswizardy.com) - he's a very clever fella!
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/para/version.rb
ADDED
data/lib/para.rb
ADDED
data/para.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'para/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "para-grids"
|
8
|
+
spec.version = Para::VERSION
|
9
|
+
spec.authors = ["Ian Thomas"]
|
10
|
+
spec.email = ["ian@ian-thomas.net"]
|
11
|
+
spec.description = %q{'para', from the greek 'beside' and the latin meaning 'alongside', is a grid system of great simplicity for use internally but available for the world.}
|
12
|
+
spec.summary = %q{A small grid framework that gets out of the way and lets the dev choose how they do things.}
|
13
|
+
spec.homepage = "http://www.github.com/finndigital/para"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
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_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
Binary file
|
@@ -0,0 +1,19 @@
|
|
1
|
+
@mixin initialise-grid{
|
2
|
+
/*
|
3
|
+
* We want to be able to space the grid, but not use padding
|
4
|
+
*/
|
5
|
+
.grid{
|
6
|
+
margin: 0 $base-grid-padding;
|
7
|
+
}
|
8
|
+
|
9
|
+
/*
|
10
|
+
* While there is a movement towards inline-block for grid elements, we favour
|
11
|
+
* display:block and floats
|
12
|
+
*/
|
13
|
+
.grid__item{
|
14
|
+
@include box-sizing(border-box);
|
15
|
+
@include float(left);
|
16
|
+
padding-left: $base-gutter-width / 2;
|
17
|
+
padding-right: $base-gutter-width / 2;
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
@mixin silent-relative{
|
2
|
+
position: relative;
|
3
|
+
}
|
4
|
+
|
5
|
+
@mixin setup-push($namespace: ''){
|
6
|
+
|
7
|
+
.#{$namespace}push-one-whole { left: 100%; @include silent-relative }
|
8
|
+
|
9
|
+
.#{$namespace}push-one-half { left: 50%; @include silent-relative }
|
10
|
+
|
11
|
+
.#{$namespace}push-one-third { left: 33.3333%; @include silent-relative }
|
12
|
+
.#{$namespace}push-two-thirds { left: 66.6666%; @include silent-relative }
|
13
|
+
|
14
|
+
.#{$namespace}push-one-quarter { left: 25%; @include silent-relative; }
|
15
|
+
.#{$namespace}push-two-quarters { @extend .#{$namespace}push-one-half; }
|
16
|
+
.#{$namespace}push-three-quarters { left: 75%; @include silent-relative; }
|
17
|
+
|
18
|
+
.#{$namespace}push-one-fifth { left: 20%; @include silent-relative }
|
19
|
+
.#{$namespace}push-two-fifths { left: 40%; @include silent-relative }
|
20
|
+
.#{$namespace}push-three-fifths { left: 60%; @include silent-relative }
|
21
|
+
.#{$namespace}push-four-fifths { left: 80%; @include silent-relative }
|
22
|
+
|
23
|
+
.#{$namespace}push-one-sixth { left: 16.666%; @include silent-relative }
|
24
|
+
.#{$namespace}push-two-sixths { @extend .#{$namespace}push-one-third; }
|
25
|
+
.#{$namespace}push-three-sixths { @extend .#{$namespace}push-one-half; }
|
26
|
+
.#{$namespace}push-four-sixths { @extend .#{$namespace}push-two-thirds; }
|
27
|
+
.#{$namespace}push-five-sixths { left: 83.3333%; @include silent-relative }
|
28
|
+
|
29
|
+
.#{$namespace}push-one-eighth { width: column-width(1,8); }
|
30
|
+
.#{$namespace}push-two-eighths { @extend .#{$namespace}push-one-quarter; }
|
31
|
+
.#{$namespace}push-three-eighths { width: column-width(3,8); }
|
32
|
+
.#{$namespace}push-four-eighths { @extend .#{$namespace}push-one-half; }
|
33
|
+
.#{$namespace}push-five-eighths { width: column-width(5,8); }
|
34
|
+
.#{$namespace}push-six-eighths { @extend .#{$namespace}push-three-quarters; }
|
35
|
+
.#{$namespace}push-seven-eights { width: column-width(7,8); }
|
36
|
+
}
|
37
|
+
|
38
|
+
@mixin setup-pull($namespace: ''){
|
39
|
+
|
40
|
+
.#{$namespace}pull-one-whole { left: 100%; @include silent-relative; }
|
41
|
+
|
42
|
+
.#{$namespace}pull-one-half { left: -50%; @include silent-relative }
|
43
|
+
|
44
|
+
.#{$namespace}pull-one-third { left: -33.3333%; @include silent-relative }
|
45
|
+
.#{$namespace}pull-two-thirds { left: -66.6666%; @include silent-relative }
|
46
|
+
|
47
|
+
.#{$namespace}pull-one-quarter { left: -25%; @include silent-relative; }
|
48
|
+
.#{$namespace}pull-two-quarters { @extend .#{$namespace}pull-one-half; }
|
49
|
+
.#{$namespace}pull-three-quarters { left: -75%; @include silent-relative; }
|
50
|
+
|
51
|
+
.#{$namespace}pull-one-fifth { left: -20%; @include silent-relative }
|
52
|
+
.#{$namespace}pull-two-fifths { left: -40%; @include silent-relative }
|
53
|
+
.#{$namespace}pull-three-fifths { left: -60%; @include silent-relative }
|
54
|
+
.#{$namespace}pull-four-fifths { left: -80%; @include silent-relative }
|
55
|
+
|
56
|
+
.#{$namespace}pull-one-sixth { left: column-width(-1,5); @include silent-relative }
|
57
|
+
.#{$namespace}pull-two-sixths { @extend .#{$namespace}pull-one-third; }
|
58
|
+
.#{$namespace}pull-three-sixths { @extend .#{$namespace}pull-one-half; }
|
59
|
+
.#{$namespace}pull-four-sixths { @extend .#{$namespace}pull-two-thirds; }
|
60
|
+
.#{$namespace}pull-five-sixths { left: column-width(-5,6); @include silent-relative }
|
61
|
+
|
62
|
+
.#{$namespace}pull-one-eighth { width: column-width(-1,8); }
|
63
|
+
.#{$namespace}pull-two-eighths { @extend .#{$namespace}pull-one-quarter; }
|
64
|
+
.#{$namespace}pull-three-eighths { width: column-width(-3,8); }
|
65
|
+
.#{$namespace}pull-four-eighths { @extend .#{$namespace}pull-one-half; }
|
66
|
+
.#{$namespace}pull-five-eighths { width: column-width(-5,8); }
|
67
|
+
.#{$namespace}pull-six-eighths { @extend .#{$namespace}pull-three-quarters; }
|
68
|
+
.#{$namespace}pull-seven-eights { width: column-width(-7,8); }
|
69
|
+
}
|
70
|
+
|
71
|
+
@mixin setup-push-pull($namespace: ''){
|
72
|
+
@include setup-push($namespace);
|
73
|
+
@include setup-pull($namespace);
|
74
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
// media queries
|
2
|
+
$palm: '(max-width:500px)'!default;
|
3
|
+
$tablet: '(min-width: 501px) and (max-width:1023px)'!default;
|
4
|
+
$portable: '(max-width:1023px)'!default;
|
5
|
+
$desk: '(min-width: 1024px)'!default;
|
6
|
+
$wide: '(min-width: 1200px)'!default;
|
7
|
+
$huge: '(min-width: 1600px)'!default;
|
8
|
+
|
9
|
+
$base-gutter-width: (30px/16px) * 1em!default;
|
10
|
+
$base-grid-padding: $base-gutter-width!default;
|
@@ -0,0 +1,34 @@
|
|
1
|
+
@mixin setup-grid($namespace: ''){
|
2
|
+
|
3
|
+
.#{$namespace}one-whole { width: 100%; }
|
4
|
+
|
5
|
+
.#{$namespace}one-half { width: 50%; }
|
6
|
+
|
7
|
+
.#{$namespace}one-third { width: column-width(1, 3); }
|
8
|
+
.#{$namespace}two-thirds { width: column-width(2, 3); }
|
9
|
+
|
10
|
+
.#{$namespace}one-quarter { width: 25% }
|
11
|
+
.#{$namespace}two-quarters { @extend .#{$namespace}one-half; }
|
12
|
+
.#{$namespace}three-quarters { width: 75% }
|
13
|
+
|
14
|
+
.#{$namespace}one-fifth { width: 20%; }
|
15
|
+
.#{$namespace}two-fifths { width: 40%; }
|
16
|
+
.#{$namespace}three-fifths { width: 60%; }
|
17
|
+
.#{$namespace}four-fifths { width: 80%; }
|
18
|
+
|
19
|
+
// Six column grid
|
20
|
+
.#{$namespace}one-sixth { width: column-width(1, 6); }
|
21
|
+
.#{$namespace}two-sixths { @extend .#{$namespace}one-third; }
|
22
|
+
.#{$namespace}three-sixths { @extend .#{$namespace}one-half; }
|
23
|
+
.#{$namespace}four-sixths { @extend .#{$namespace}two-thirds; }
|
24
|
+
.#{$namespace}five-sixths { width: column-width(5, 6); }
|
25
|
+
|
26
|
+
//Eight column grid
|
27
|
+
.#{$namespace}one-eighth { width: column-width(1,8); }
|
28
|
+
.#{$namespace}two-eighths { @extend .#{$namespace}one-quarter; }
|
29
|
+
.#{$namespace}three-eighths { width: column-width(3,8); }
|
30
|
+
.#{$namespace}four-eighths { @extend .#{$namespace}one-half; }
|
31
|
+
.#{$namespace}five-eighths { width: column-width(5,8); }
|
32
|
+
.#{$namespace}six-eighths { @extend .#{$namespace}three-quarters; }
|
33
|
+
.#{$namespace}seven-eights { width: column-width(7,8); }
|
34
|
+
}
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: para-grids
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ian Thomas
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-10-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: '''para'', from the greek ''beside'' and the latin meaning ''alongside'',
|
42
|
+
is a grid system of great simplicity for use internally but available for the world.'
|
43
|
+
email:
|
44
|
+
- ian@ian-thomas.net
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- lib/para.rb
|
55
|
+
- lib/para/version.rb
|
56
|
+
- para.gemspec
|
57
|
+
- stylesheets/.DS_Store
|
58
|
+
- stylesheets/_para.scss
|
59
|
+
- stylesheets/para/_functions.scss
|
60
|
+
- stylesheets/para/_grids.scss
|
61
|
+
- stylesheets/para/_media.scss
|
62
|
+
- stylesheets/para/_push-pull.scss
|
63
|
+
- stylesheets/para/_settings.scss
|
64
|
+
- stylesheets/para/_widths.scss
|
65
|
+
homepage: http://www.github.com/finndigital/para
|
66
|
+
licenses:
|
67
|
+
- MIT
|
68
|
+
metadata: {}
|
69
|
+
post_install_message:
|
70
|
+
rdoc_options: []
|
71
|
+
require_paths:
|
72
|
+
- lib
|
73
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 2.0.3
|
86
|
+
signing_key:
|
87
|
+
specification_version: 4
|
88
|
+
summary: A small grid framework that gets out of the way and lets the dev choose how
|
89
|
+
they do things.
|
90
|
+
test_files: []
|