grid-coordinates 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +66 -0
- data/Rakefile +28 -0
- data/VERSION +1 -0
- data/lib/grid-coordinates.rb +2 -0
- data/lib/grid-coordinates/compass_extension.rb +7 -0
- data/lib/grid-coordinates/sass_extensions.rb +1 -0
- data/sass/grid-coordinates/grid.sass +83 -0
- data/templates/project/manifest.rb +3 -0
- data/templates/project/partials/_base.sass +3 -0
- data/templates/project/partials/_grid.sass +64 -0
- data/templates/project/styles.sass +1 -0
- metadata +74 -0
data/README.textile
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
h1. Grid Coordinates - Compass Plugin
|
2
|
+
|
3
|
+
Grid Coordinates is Simple. Grid Coordinates is just a grid. It also supports nested grids and is also able to generate the CSS for a multitude of grid coordinates.
|
4
|
+
|
5
|
+
The default grid setup is 960px wide, 12 columns at 60px each with a 20px gutter. Feel free to mix it up with something like -- 960 / 16 / 40 / 20, or 800 / 10 / 60 / 20.
|
6
|
+
|
7
|
+
Just update the 4 variables to change the coordinates of your grid. Use 1kbgrid.com as a guide to the grid's coordinate options.
|
8
|
+
|
9
|
+
Grid Coordinates is a "Compass":http://compass-style.org/ plugin based on Tyler Tate's 1kb CSS Grid project.
|
10
|
+
|
11
|
+
h2. Installation
|
12
|
+
|
13
|
+
First let's make sure we have both GitHub and Gemcutter set as sources for Gems. You can check your current sources by entering @gem sources@ in your command prompt.
|
14
|
+
|
15
|
+
bc. sudo gem sources -a http://gems.github.com/
|
16
|
+
sudo gem sources -a http://gemcutter.org/
|
17
|
+
|
18
|
+
Next, let's install Grid Coordinates and Compass
|
19
|
+
|
20
|
+
bc. sudo gem install compass-grid-coordinates-plugin
|
21
|
+
|
22
|
+
Compass should get installed with Grid Coordinates because it's set as a dependency. If for some reason it didn't, you will need to manually install it.
|
23
|
+
|
24
|
+
bc. gem install chriseppstein-compass
|
25
|
+
|
26
|
+
h2. Create a Grid Coordinates-based Compass Project
|
27
|
+
|
28
|
+
bc. rails myapp
|
29
|
+
cd myapp
|
30
|
+
compass --rails -r grid-coordinates -f grid-coordinates .
|
31
|
+
|
32
|
+
You'll be asked the default Compass setup questions such as where to place your Sass and Compiled CSS.
|
33
|
+
|
34
|
+
Once that is finished, you'll want to take a peek at @partials/_grid.sass@.
|
35
|
+
|
36
|
+
By default @compass/utilities.sass@ and @blueprint/reset.sass@ are being imported into your new @partials/_base.sass@ file.
|
37
|
+
|
38
|
+
Your setup may differ. And that's ok.
|
39
|
+
|
40
|
+
h2. Customizing your Grid System
|
41
|
+
|
42
|
+
[[Customize your grid]]
|
43
|
+
|
44
|
+
h2. Making Semantic Grids
|
45
|
+
|
46
|
+
[[Building a semantic grid]]
|
47
|
+
|
48
|
+
h2. Note on patches and pull requests
|
49
|
+
|
50
|
+
* Fork the project!
|
51
|
+
* Have fun...add new features, hack, hack, bug fix, etc.
|
52
|
+
* Comment your code using the existing comment syntax in the plugin
|
53
|
+
* Commit, DO NOT mess with rakefile, version, or history.
|
54
|
+
(if you want to have your own version, that is fine but
|
55
|
+
bump version in a commit by itself I can ignore when I pull)
|
56
|
+
* Send me a pull request. Bonus points for topic branches.
|
57
|
+
|
58
|
+
h2. License
|
59
|
+
|
60
|
+
Copyright (c) 2009 Adam Stacoviak
|
61
|
+
|
62
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
63
|
+
|
64
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
65
|
+
|
66
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'sass'
|
4
|
+
require 'lib/grid-coordinates/sass_extensions'
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'jeweler'
|
8
|
+
Jeweler::Tasks.new do |gem|
|
9
|
+
gem.name = "grid-coordinates"
|
10
|
+
gem.summary = %Q{Grid Coordinates is a Compass extension based on Tyler Tate's 1kb CSS Grid project.}
|
11
|
+
gem.description = %Q{Grid Coordinates is a Compass extension. It's simple. It's just a grid that supports nested grids and is also able to generate the CSS for a multitude of grid coordinates.}
|
12
|
+
gem.email = "adam@gethandcrafted.com"
|
13
|
+
gem.homepage = "http://github.com/handcrafted/grid-coordinates"
|
14
|
+
gem.authors = ["Adam Stacoviak"]
|
15
|
+
gem.has_rdoc = false
|
16
|
+
gem.add_dependency('compass', '>= 0.8.16')
|
17
|
+
gem.files = []
|
18
|
+
gem.files << "README.textile"
|
19
|
+
gem.files << "VERSION"
|
20
|
+
gem.files << "Rakefile"
|
21
|
+
gem.files += Dir.glob("lib/**/*")
|
22
|
+
gem.files += Dir.glob("sass/**/*")
|
23
|
+
gem.files += Dir.glob("spec/**/*")
|
24
|
+
gem.files += Dir.glob("templates/**/*.*")
|
25
|
+
end
|
26
|
+
rescue LoadError
|
27
|
+
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
28
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.3
|
@@ -0,0 +1,7 @@
|
|
1
|
+
if defined?(Compass)
|
2
|
+
options = Hash.new
|
3
|
+
options[:stylesheets_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sass'))
|
4
|
+
options[:templates_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates'))
|
5
|
+
|
6
|
+
Compass::Frameworks.register('grid-coordinates', options)
|
7
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'sass'
|
@@ -0,0 +1,83 @@
|
|
1
|
+
// ----------------------------------------------------------------------------
|
2
|
+
// Grid Coordinates is based on Tyler Tate's 1kb CSS Grid project (1kbgrid.com)
|
3
|
+
// ----------------------------------------------------------------------------
|
4
|
+
// The default grid is 960px wide, 12 columns at 60px each with a 20px gutter.
|
5
|
+
//
|
6
|
+
// Update the 4 variables below to change your grid setup.
|
7
|
+
// Use 1kbgrid.com as a guide to the various grid coordinates possible.
|
8
|
+
|
9
|
+
@import compass/utilities
|
10
|
+
|
11
|
+
!grid_width ||= 960px
|
12
|
+
!grid_columns ||= 12
|
13
|
+
!grid_pixels ||= 60px
|
14
|
+
!grid_gutter_width ||= 20px
|
15
|
+
|
16
|
+
=grid(!grid_columns)
|
17
|
+
+column
|
18
|
+
@if !grid_columns == 1
|
19
|
+
width = !grid_pixels
|
20
|
+
@else
|
21
|
+
width = (!grid_columns * !grid_pixels) + (!grid_columns * !grid_gutter_width - !grid_gutter_width)
|
22
|
+
|
23
|
+
=column
|
24
|
+
+float-left
|
25
|
+
margin = 0 !grid_gutter_width / 2
|
26
|
+
overflow: hidden
|
27
|
+
|
28
|
+
=grid-container(!nested = "nil")
|
29
|
+
@if !nested == "nested"
|
30
|
+
margin: 0
|
31
|
+
left = -!grid_gutter_width / 2
|
32
|
+
right = -!grid_gutter_width / 2
|
33
|
+
display: inline-block
|
34
|
+
width: auto
|
35
|
+
@else
|
36
|
+
margin: 0 auto
|
37
|
+
overflow: hidden
|
38
|
+
width = !grid_width
|
39
|
+
|
40
|
+
=grid-full
|
41
|
+
+grid(!grid_columns)
|
42
|
+
|
43
|
+
.grid_container
|
44
|
+
+grid-container
|
45
|
+
&.nested
|
46
|
+
+grid-container("nested")
|
47
|
+
.grid
|
48
|
+
&.one
|
49
|
+
+grid(1)
|
50
|
+
&.two
|
51
|
+
+grid(2)
|
52
|
+
&.three
|
53
|
+
+grid(3)
|
54
|
+
&.four
|
55
|
+
+grid(4)
|
56
|
+
&.five
|
57
|
+
+grid(5)
|
58
|
+
&.six
|
59
|
+
+grid(6)
|
60
|
+
&.seven
|
61
|
+
+grid(7)
|
62
|
+
&.eight
|
63
|
+
+grid(8)
|
64
|
+
&.nine
|
65
|
+
+grid(9)
|
66
|
+
&.ten
|
67
|
+
+grid(10)
|
68
|
+
&.eleven
|
69
|
+
+grid(11)
|
70
|
+
&.twelve
|
71
|
+
+grid(12)
|
72
|
+
&.full
|
73
|
+
+grid-full
|
74
|
+
|
75
|
+
// Example styling for prototyping a grid with text labels
|
76
|
+
// As seen here: http://flickr.com/ ...#TODO
|
77
|
+
.example
|
78
|
+
p
|
79
|
+
background: #333 !important
|
80
|
+
border: 1px solid #000 !important
|
81
|
+
color: #fff !important
|
82
|
+
line-height: 70px !important
|
83
|
+
text-align: center !important
|
@@ -0,0 +1,64 @@
|
|
1
|
+
// The following locks in our grid coordinates
|
2
|
+
|
3
|
+
!grid_width ||= 960px
|
4
|
+
!grid_columns ||= 12
|
5
|
+
!grid_pixels ||= 60px
|
6
|
+
!grid_gutter_width ||= 20px
|
7
|
+
|
8
|
+
@import grid-coordinates/grid
|
9
|
+
|
10
|
+
// The following code generates the required CSS for your grid
|
11
|
+
// This is just an example. It is already done for you inside the plugin
|
12
|
+
//
|
13
|
+
// See below for an example on how to use Grid Coordinates
|
14
|
+
// using the mixin method using semantic markup and selectors
|
15
|
+
//
|
16
|
+
// .grid_container
|
17
|
+
// +grid-container
|
18
|
+
// &.nested
|
19
|
+
// +grid-container("nested")
|
20
|
+
// .grid
|
21
|
+
// &.one
|
22
|
+
// +grid(1)
|
23
|
+
// &.two
|
24
|
+
// +grid(2)
|
25
|
+
// &.three
|
26
|
+
// +grid(3)
|
27
|
+
// &.four
|
28
|
+
// +grid(4)
|
29
|
+
// &.five
|
30
|
+
// +grid(5)
|
31
|
+
// &.six
|
32
|
+
// +grid(6)
|
33
|
+
// &.seven
|
34
|
+
// +grid(7)
|
35
|
+
// &.eight
|
36
|
+
// +grid(8)
|
37
|
+
// &.nine
|
38
|
+
// +grid(9)
|
39
|
+
// &.ten
|
40
|
+
// +grid(10)
|
41
|
+
// &.eleven
|
42
|
+
// +grid(11)
|
43
|
+
// &.twelve
|
44
|
+
// +grid(12)
|
45
|
+
// &.full
|
46
|
+
// +grid-full
|
47
|
+
|
48
|
+
// Like most Compass users, I build my layouts with semantic markup and selectors
|
49
|
+
//
|
50
|
+
// #branding, #page, #footer
|
51
|
+
// +grid-container
|
52
|
+
//
|
53
|
+
// #branding
|
54
|
+
// +grid(4)
|
55
|
+
// #nav_main
|
56
|
+
// +grid(8)
|
57
|
+
//
|
58
|
+
// #page_body
|
59
|
+
// +grid(8)
|
60
|
+
// &.wide
|
61
|
+
// +grid(12)
|
62
|
+
//
|
63
|
+
// #page_sidebar
|
64
|
+
// +grid(4)
|
@@ -0,0 +1 @@
|
|
1
|
+
@import partials/base.sass
|
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: grid-coordinates
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam Stacoviak
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-01 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: compass
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.8.16
|
24
|
+
version:
|
25
|
+
description: Grid Coordinates is a Compass extension. It's simple. It's just a grid that supports nested grids and is also able to generate the CSS for a multitude of grid coordinates.
|
26
|
+
email: adam@gethandcrafted.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README.textile
|
33
|
+
files:
|
34
|
+
- README.textile
|
35
|
+
- Rakefile
|
36
|
+
- VERSION
|
37
|
+
- lib/grid-coordinates.rb
|
38
|
+
- lib/grid-coordinates/compass_extension.rb
|
39
|
+
- lib/grid-coordinates/sass_extensions.rb
|
40
|
+
- sass/grid-coordinates/grid.sass
|
41
|
+
- templates/project/manifest.rb
|
42
|
+
- templates/project/partials/_base.sass
|
43
|
+
- templates/project/partials/_grid.sass
|
44
|
+
- templates/project/styles.sass
|
45
|
+
has_rdoc: true
|
46
|
+
homepage: http://github.com/handcrafted/grid-coordinates
|
47
|
+
licenses: []
|
48
|
+
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options:
|
51
|
+
- --charset=UTF-8
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "0"
|
65
|
+
version:
|
66
|
+
requirements: []
|
67
|
+
|
68
|
+
rubyforge_project:
|
69
|
+
rubygems_version: 1.3.4
|
70
|
+
signing_key:
|
71
|
+
specification_version: 3
|
72
|
+
summary: Grid Coordinates is a Compass extension based on Tyler Tate's 1kb CSS Grid project.
|
73
|
+
test_files: []
|
74
|
+
|