compass-squaregrid-plugin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +22 -0
- data/README.mkdn +59 -0
- data/Rakefile +60 -0
- data/VERSION +1 -0
- data/compass-squaregrid-plugin.gemspec +50 -0
- data/lib/squaregrid.rb +2 -0
- data/stylesheets/squaregrid/_grid.sass +91 -0
- data/stylesheets/squaregrid/_text.sass +47 -0
- data/templates/project/grid.sass +32 -0
- data/templates/project/manifest.rb +17 -0
- data/templates/project/text.sass +8 -0
- metadata +85 -0
data/.gitignore
ADDED
data/README.mkdn
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
960 Grid System - Compass Plugin
|
2
|
+
================================
|
3
|
+
|
4
|
+
* Port of Version 1.0
|
5
|
+
* 2008-03-24
|
6
|
+
|
7
|
+
Created by Nathan Smith. See the official site for more info: <http://960.gs/>
|
8
|
+
|
9
|
+
---------
|
10
|
+
|
11
|
+
This plugin adds the 960 Grid System framework to [Compass](http://compass-style.org/).
|
12
|
+
|
13
|
+
Install
|
14
|
+
=======
|
15
|
+
|
16
|
+
gem install compass-960-plugin
|
17
|
+
|
18
|
+
Create a 960-based Compass Project
|
19
|
+
==================================
|
20
|
+
|
21
|
+
compass create -r ninesixty my_project --using 960
|
22
|
+
|
23
|
+
Or, If you prefer to use Sass's indentation based syntax:
|
24
|
+
|
25
|
+
compass create -r ninesixty my_project --using 960 --syntax sass
|
26
|
+
|
27
|
+
Then edit your `grid.sass` and `text.sass` files accordingly. A reset is added into grid.sass automatically.
|
28
|
+
|
29
|
+
Customizing your Grid System
|
30
|
+
============================
|
31
|
+
|
32
|
+
To create a grid system with other number of columns use the `+grid-system` mixin to generate
|
33
|
+
the corresponding classes.
|
34
|
+
|
35
|
+
Example:
|
36
|
+
|
37
|
+
#wrap
|
38
|
+
+grid-system(24)
|
39
|
+
|
40
|
+
Making Semantic Grids
|
41
|
+
=====================
|
42
|
+
|
43
|
+
* Use the `+grid-container` mixin to declare your container element.
|
44
|
+
* Use the `+grid` mixin to declare a grid element.
|
45
|
+
* Use the `+alpha` and `+omega` mixins to declare the first and last grid elements for a row.
|
46
|
+
* User the `+grid-prefix` and `+grid-suffix` mixins to add grid columns before or after a grid element.
|
47
|
+
|
48
|
+
Example:
|
49
|
+
|
50
|
+
#wrap
|
51
|
+
+grid-container
|
52
|
+
#left-nav
|
53
|
+
+alpha
|
54
|
+
+grid(5,16)
|
55
|
+
#main-content
|
56
|
+
+grid-prefix(1,16)
|
57
|
+
+grid(10, 16)
|
58
|
+
+omega
|
59
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
|
5
|
+
|
6
|
+
begin
|
7
|
+
require 'jeweler'
|
8
|
+
Jeweler::Tasks.new do |gem|
|
9
|
+
gem.name = "compass-squaregrid-plugin"
|
10
|
+
gem.summary = %Q{The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/ }
|
11
|
+
gem.description = %Q{The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/}
|
12
|
+
gem.email = "me@davidjrice.co.uk"
|
13
|
+
gem.homepage = "http://github.com/davidjrice/compass-squaregrid-plugin"
|
14
|
+
gem.authors = ["David Rice"]
|
15
|
+
gem.add_dependency "compass", ">= 0.10.0"
|
16
|
+
end
|
17
|
+
Jeweler::GemcutterTasks.new
|
18
|
+
rescue LoadError
|
19
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
20
|
+
end
|
21
|
+
|
22
|
+
begin
|
23
|
+
require 'spec/rake/spectask'
|
24
|
+
Spec::Rake::SpecTask.new do |t|
|
25
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
26
|
+
t.verbose = true
|
27
|
+
end
|
28
|
+
rescue LoadError
|
29
|
+
task :spec do
|
30
|
+
abort "RSpec is not available. In order to run specs, you must: sudo gem install rspec"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
begin
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/test_*.rb'
|
39
|
+
test.verbose = true
|
40
|
+
end
|
41
|
+
rescue LoadError
|
42
|
+
task :rcov do
|
43
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install rcov"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
task :test => :check_dependencies
|
48
|
+
|
49
|
+
task :default => :test
|
50
|
+
|
51
|
+
Rake::RDocTask.new do |rdoc|
|
52
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
53
|
+
|
54
|
+
rdoc.rdoc_dir = 'rdoc'
|
55
|
+
rdoc.title = "DeviceAtlas #{version}"
|
56
|
+
rdoc.rdoc_files.include('README*')
|
57
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
58
|
+
end
|
59
|
+
|
60
|
+
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{compass-squaregrid-plugin}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["David Rice"]
|
12
|
+
s.date = %q{2010-10-27}
|
13
|
+
s.description = %q{The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/}
|
14
|
+
s.email = %q{me@davidjrice.co.uk}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.mkdn"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".gitignore",
|
20
|
+
"README.mkdn",
|
21
|
+
"Rakefile",
|
22
|
+
"VERSION",
|
23
|
+
"compass-squaregrid-plugin.gemspec",
|
24
|
+
"lib/squaregrid.rb",
|
25
|
+
"stylesheets/squaregrid/_grid.sass",
|
26
|
+
"stylesheets/squaregrid/_text.sass",
|
27
|
+
"templates/project/grid.sass",
|
28
|
+
"templates/project/manifest.rb",
|
29
|
+
"templates/project/text.sass"
|
30
|
+
]
|
31
|
+
s.homepage = %q{http://github.com/davidjrice/compass-squaregrid-plugin}
|
32
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
33
|
+
s.require_paths = ["lib"]
|
34
|
+
s.rubygems_version = %q{1.3.6}
|
35
|
+
s.summary = %q{The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/}
|
36
|
+
|
37
|
+
if s.respond_to? :specification_version then
|
38
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
39
|
+
s.specification_version = 3
|
40
|
+
|
41
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
42
|
+
s.add_runtime_dependency(%q<compass>, [">= 0.10.0"])
|
43
|
+
else
|
44
|
+
s.add_dependency(%q<compass>, [">= 0.10.0"])
|
45
|
+
end
|
46
|
+
else
|
47
|
+
s.add_dependency(%q<compass>, [">= 0.10.0"])
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
data/lib/squaregrid.rb
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
$squaregrid-bleed-width: 14px !default
|
2
|
+
$squaregrid-gutter-width: 28px !default
|
3
|
+
$squaregrid-grid-width: 1008px !default
|
4
|
+
$squaregrid-columns: 35 !default
|
5
|
+
|
6
|
+
=grid-wrap
|
7
|
+
margin-left: auto
|
8
|
+
margin-right: auto
|
9
|
+
width: $squaregrid-grid-width - $squaregrid-bleed-width
|
10
|
+
overflow: hidden
|
11
|
+
|
12
|
+
=grid-container
|
13
|
+
margin-left: -$squaregrid-bleed-width/2
|
14
|
+
width: $squaregrid-grid-width
|
15
|
+
|
16
|
+
=grid-width($n, $cols: $squaregrid-columns, $gutter-width: $squaregrid-gutter-width)
|
17
|
+
width: ($squaregrid-grid-width - $gutter-width) / $cols * $n
|
18
|
+
|
19
|
+
=grid-unit-base($gutter-width: $squaregrid-gutter-width)
|
20
|
+
display: inline
|
21
|
+
float: left
|
22
|
+
margin:
|
23
|
+
left: $gutter-width / 2
|
24
|
+
right: $gutter-width / 2
|
25
|
+
bottom: $gutter-width
|
26
|
+
|
27
|
+
=grid($n, $cols: $squaregrid-columns, $gutter-width: $squaregrid-gutter-width)
|
28
|
+
+grid-unit-base($gutter-width)
|
29
|
+
+grid-width($n, $cols, $gutter-width)
|
30
|
+
|
31
|
+
=alpha
|
32
|
+
margin-left: 0
|
33
|
+
|
34
|
+
=omega
|
35
|
+
margin-right: 0
|
36
|
+
|
37
|
+
=grids($cols: $squaregrid-columns, $gutter-width: $squaregrid-gutter-width)
|
38
|
+
#{enumerate(".grid", 1, $cols, "_")}
|
39
|
+
+grid-unit-base
|
40
|
+
@for $n from 1 through $cols
|
41
|
+
.grid_#{$n}
|
42
|
+
+grid-width($n, $cols, $gutter-width)
|
43
|
+
|
44
|
+
=grid-prefix($n, $cols: $squaregrid-columns)
|
45
|
+
padding-left: $squaregrid-grid-width / $cols * $n
|
46
|
+
|
47
|
+
=grid-prefixes($cols: $squaregrid-columns)
|
48
|
+
@for $n from 1 through $cols - 1
|
49
|
+
.prefix_#{$n}
|
50
|
+
+grid-prefix($n, $cols)
|
51
|
+
|
52
|
+
=grid-suffix($n, $cols: $squaregrid-columns)
|
53
|
+
padding-right: $squaregrid-grid-width / $cols * $n
|
54
|
+
|
55
|
+
=grid-suffixes($cols: $squaregrid-columns)
|
56
|
+
@for $n from 1 through $cols - 1
|
57
|
+
.suffix_#{$n}
|
58
|
+
+grid-suffix($n, $cols)
|
59
|
+
|
60
|
+
=grid-children
|
61
|
+
.alpha
|
62
|
+
+alpha
|
63
|
+
.omega
|
64
|
+
+omega
|
65
|
+
|
66
|
+
=grid-move-base
|
67
|
+
position: relative
|
68
|
+
|
69
|
+
=grid-push($n, $cols)
|
70
|
+
left: ($squaregrid-grid-width / $cols) * $n
|
71
|
+
|
72
|
+
=grid-pull($n, $cols)
|
73
|
+
left: -($squaregrid-grid-width / $cols) * $n
|
74
|
+
|
75
|
+
=grid-movements($cols: $squaregrid-columns)
|
76
|
+
#{enumerate(".push", 1, $cols, "_")},
|
77
|
+
#{enumerate(".pull", 1, $cols, "_")}
|
78
|
+
+grid-move-base
|
79
|
+
@for $n from 1 through $cols
|
80
|
+
.push_#{$n}
|
81
|
+
+grid-push($n, $cols)
|
82
|
+
.pull_#{$n}
|
83
|
+
+grid-pull($n, $cols)
|
84
|
+
|
85
|
+
=grid-system($cols: $squaregrid-columns)
|
86
|
+
+grid-container
|
87
|
+
+grids($cols)
|
88
|
+
+grid-prefixes($cols)
|
89
|
+
+grid-suffixes($cols)
|
90
|
+
+grid-children
|
91
|
+
+grid-movements($cols)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
$ninesixty-font-family: unquote("Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif") !default
|
2
|
+
|
3
|
+
=text($font-family: $ninesixty-font-family)
|
4
|
+
body
|
5
|
+
font: unquote("13px/1.5") $font-family
|
6
|
+
a:focus
|
7
|
+
outline: 1px dotted invert
|
8
|
+
hr
|
9
|
+
border-color: #cccccc
|
10
|
+
border-style: solid
|
11
|
+
border-width: 1px 0 0
|
12
|
+
clear: both
|
13
|
+
height: 0
|
14
|
+
h1
|
15
|
+
font-size: 25px
|
16
|
+
h2
|
17
|
+
font-size: 23px
|
18
|
+
h3
|
19
|
+
font-size: 21px
|
20
|
+
h4
|
21
|
+
font-size: 19px
|
22
|
+
h5
|
23
|
+
font-size: 17px
|
24
|
+
h6
|
25
|
+
font-size: 15px
|
26
|
+
ol
|
27
|
+
list-style: decimal
|
28
|
+
ul
|
29
|
+
list-style: square
|
30
|
+
li
|
31
|
+
margin-left: 30px
|
32
|
+
p,
|
33
|
+
dl,
|
34
|
+
hr,
|
35
|
+
h1,
|
36
|
+
h2,
|
37
|
+
h3,
|
38
|
+
h4,
|
39
|
+
h5,
|
40
|
+
h6,
|
41
|
+
ol,
|
42
|
+
ul,
|
43
|
+
pre,
|
44
|
+
table,
|
45
|
+
address,
|
46
|
+
fieldset
|
47
|
+
margin-bottom: 20px
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/* 960 Grid System ~ Core CSS.
|
2
|
+
* Learn more ~ http://960.gs/
|
3
|
+
* *
|
4
|
+
* Licensed under GPL and MIT.
|
5
|
+
|
6
|
+
@import compass/reset
|
7
|
+
@import 960/grid
|
8
|
+
|
9
|
+
// The following generates the default grids provided by the css version of 960.gs
|
10
|
+
.container_12
|
11
|
+
+grid-system(12)
|
12
|
+
|
13
|
+
.container_16
|
14
|
+
+grid-system(16)
|
15
|
+
|
16
|
+
// But most compass users prefer to construct semantic layouts like so (two column layout with header and footer):
|
17
|
+
|
18
|
+
$ninesixty-columns: 24
|
19
|
+
|
20
|
+
.two-column
|
21
|
+
+grid-container
|
22
|
+
#header,
|
23
|
+
#footer,
|
24
|
+
#sidebar,
|
25
|
+
#main-content
|
26
|
+
+grid-unit-base
|
27
|
+
#header, #footer
|
28
|
+
+grid-width(24)
|
29
|
+
#sidebar
|
30
|
+
+grid-width(8)
|
31
|
+
#main-content
|
32
|
+
+grid-width(16)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
stylesheet 'grid.sass', :media => "screen, projection"
|
2
|
+
stylesheet 'text.sass', :media => "screen, projection"
|
3
|
+
|
4
|
+
description "The 960 Grid System."
|
5
|
+
|
6
|
+
help %Q{
|
7
|
+
Please see the 960 website for documentation:
|
8
|
+
|
9
|
+
http://960.gs/
|
10
|
+
}
|
11
|
+
|
12
|
+
welcome_message %Q{
|
13
|
+
Please see the 960 website for documentation:
|
14
|
+
|
15
|
+
http://960.gs/
|
16
|
+
}
|
17
|
+
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: compass-squaregrid-plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- David Rice
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-10-27 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: compass
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
- 10
|
30
|
+
- 0
|
31
|
+
version: 0.10.0
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
description: The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/
|
35
|
+
email: me@davidjrice.co.uk
|
36
|
+
executables: []
|
37
|
+
|
38
|
+
extensions: []
|
39
|
+
|
40
|
+
extra_rdoc_files:
|
41
|
+
- README.mkdn
|
42
|
+
files:
|
43
|
+
- .gitignore
|
44
|
+
- README.mkdn
|
45
|
+
- Rakefile
|
46
|
+
- VERSION
|
47
|
+
- compass-squaregrid-plugin.gemspec
|
48
|
+
- lib/squaregrid.rb
|
49
|
+
- stylesheets/squaregrid/_grid.sass
|
50
|
+
- stylesheets/squaregrid/_text.sass
|
51
|
+
- templates/project/grid.sass
|
52
|
+
- templates/project/manifest.rb
|
53
|
+
- templates/project/text.sass
|
54
|
+
has_rdoc: true
|
55
|
+
homepage: http://github.com/davidjrice/compass-squaregrid-plugin
|
56
|
+
licenses: []
|
57
|
+
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options:
|
60
|
+
- --charset=UTF-8
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
segments:
|
68
|
+
- 0
|
69
|
+
version: "0"
|
70
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
segments:
|
75
|
+
- 0
|
76
|
+
version: "0"
|
77
|
+
requirements: []
|
78
|
+
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 1.3.6
|
81
|
+
signing_key:
|
82
|
+
specification_version: 3
|
83
|
+
summary: The Square Grid System is a simple grid system for designers and developers http://thesquaregrid.com/
|
84
|
+
test_files: []
|
85
|
+
|