compass-vgrid-plugin 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Aaron Russell
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # vGrid - Compass plugin
2
+
3
+ vGrid is a Compass compatible SASS port of the [Variable Grid System](http://www.spry-soft.com/grids/) by SprySoft. Provides fixed, fluid and elastic grids and complete control over the grid system.
4
+
5
+ The original Variable Grid System is based heavily on the [960 Grid System](http://960.gs/) by Nathan Smith, and then the [Fluid 960 Grid System](http://www.designinfluences.com/fluid960gs/) by Design Influences.
6
+
7
+ This Compass plugin is written and maintained by [Aaron Russell](http://www.aaronrussell.co.uk/) and borrows heavily from Chris Eppsteins original [SASS port](http://github.com/chriseppstein/compass-960-plugin) of 960.gs.
8
+
9
+ ## Installation
10
+
11
+ Installation is simple via Ruby Gems. [Compass](http://compass-style.org/) is required.
12
+
13
+ sudo gem install compass-vgrid-plugin
14
+
15
+ ## Create a vGrid-based Compass project
16
+
17
+ To create a vGrid-based compass project simply:
18
+
19
+ compass -r vgrid -f <framework> <project name>
20
+
21
+ vGrid provides three seperate framework options:
22
+
23
+ * `fixed` - Fixed width grid
24
+ * `fluid` - Fluid width grid
25
+ * `elastic` - Elastic width grid (framework still in development)
26
+
27
+ ## Using vGrid with an existing project
28
+
29
+ To use vGrid with an existing project simply import the required framework to your SASS. For example:
30
+
31
+ @import vgrid/fixed.sass
32
+
33
+ or
34
+
35
+ @import vgrid/fluid.sass
36
+
37
+ ## Creating a grid system
38
+
39
+ To create the default CSS classes provided by the Variable Grid System simply use the `+grid_system` mixin. Optionally you can pass the number of columns of your layout to the mixin (defaults to 12):
40
+
41
+ // Creates a 24 column grid system
42
+ +grid_system(24)
43
+
44
+ ## vGrid variables
45
+
46
+ Typically, you will want to customize your grid system. vGrid provides a number of variables which can be set to alter the grid system:
47
+
48
+ * `!vgrid_width` - The width of the grid system. Defaults to `960px`. Not used with `fluid` framework.
49
+ * `!vgrid_columns` - The number of columns in the grid system. Defaults to `12`.
50
+ * `!vgrid_gutter` - The width of each column gutter. Defaults to `20px`. Not used with `fluid` framework.
51
+
52
+ ## Making semantic grids
53
+
54
+ It's preferable not to use meaningless class names in your HTML markup. A better solution is to mix the styles from the grid system in with your semantic IDs and classes. vGrid provides a number mixins to allow this:
55
+
56
+ * `+grid_container` - Declares a container element.
57
+ * `+grid` - Declares a grid element.
58
+ * `+alpha` & `+omega` - Removes the left and right margins from the grid element.
59
+ * `+grid_prefix` & `+grid_suffix` - Adds columns before or after the grid element.
60
+ * `+grid_push` & `+grid_pull` - As above but for absolutely positioned grid elements.
61
+ * `+clearfix` - Clears floated elements.
62
+
63
+ For example:
64
+
65
+ !vgrid_columns = 16
66
+
67
+ #wrap
68
+ +grid_container
69
+ #header, #footer
70
+ +grid(16)
71
+ #left-nav
72
+ +grid(5)
73
+ #main-content
74
+ +grid_prefix(1)
75
+ +grid(10)
76
+
77
+ ## Copyright
78
+
79
+ Copyright (c) 2010 [Aaron Russell](http://www.aaronrussell.co.uk/). See LICENSE for details.
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "compass-vgrid-plugin"
8
+ gem.summary = %Q{Compass compatible SASS port of the Variable Grid System. Based on the 960 Grid System.}
9
+ gem.description = %Q{A Compass compatible SASS port of the Variable Grid System by Spry Soft (http://www.spry-soft.com/grids/). Based in the 960 Grid System (http://960.gs/). Provides fixed, fluid and elastic grids with complete control over the grid system.}
10
+ gem.email = "aaron@gc4.co.uk"
11
+ gem.homepage = "http://github.com/aaronrussell/compass-vgrid-plugin"
12
+ gem.authors = ["Aaron Russell"]
13
+ gem.add_dependency "compass", ">= 0"
14
+ end
15
+ Jeweler::GemcutterTasks.new
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
18
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.2.0
@@ -0,0 +1,59 @@
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-vgrid-plugin}
8
+ s.version = "0.2.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Aaron Russell"]
12
+ s.date = %q{2010-01-10}
13
+ s.description = %q{A Compass compatible SASS port of the Variable Grid System by Spry Soft (http://www.spry-soft.com/grids/). Based in the 960 Grid System (http://960.gs/). Provides fixed, fluid and elastic grids with complete control over the grid system.}
14
+ s.email = %q{aaron@gc4.co.uk}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".gitignore",
22
+ "LICENSE",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "compass-vgrid-plugin.gemspec",
27
+ "lib/vgrid.rb",
28
+ "lib/vgrid/compass_plugin.rb",
29
+ "sass/vgrid/_elastic.sass",
30
+ "sass/vgrid/_fixed.sass",
31
+ "sass/vgrid/_fluid.sass",
32
+ "sass/vgrid/shared/_grid_system.sass",
33
+ "templates/elastic/project/grid.sass",
34
+ "templates/elastic/project/manifest.rb",
35
+ "templates/fixed/project/grid.sass",
36
+ "templates/fixed/project/manifest.rb",
37
+ "templates/fluid/project/grid.sass",
38
+ "templates/fluid/project/manifest.rb"
39
+ ]
40
+ s.homepage = %q{http://github.com/aaronrussell/compass-vgrid-plugin}
41
+ s.rdoc_options = ["--charset=UTF-8"]
42
+ s.require_paths = ["lib"]
43
+ s.rubygems_version = %q{1.3.5}
44
+ s.summary = %q{Compass compatible SASS port of the Variable Grid System. Based on the 960 Grid System.}
45
+
46
+ if s.respond_to? :specification_version then
47
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
48
+ s.specification_version = 3
49
+
50
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
51
+ s.add_runtime_dependency(%q<compass>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<compass>, [">= 0"])
54
+ end
55
+ else
56
+ s.add_dependency(%q<compass>, [">= 0"])
57
+ end
58
+ end
59
+
@@ -0,0 +1,7 @@
1
+ ["fixed", "fluid", "elastic"].each do |framework|
2
+ options = {
3
+ :stylesheets_directory => File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sass')),
4
+ :templates_directory => File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates', framework))
5
+ }
6
+ Compass::Frameworks.register(framework, options)
7
+ end
data/lib/vgrid.rb ADDED
@@ -0,0 +1 @@
1
+ require File.join(File.dirname(__FILE__), 'vgrid', 'compass_plugin')
File without changes
@@ -0,0 +1,60 @@
1
+ =grid_container
2
+ :margin-left auto
3
+ :margin-right auto
4
+ :width= !vgrid_width
5
+
6
+ =grid_width(!n, !cols = !vgrid_columns, !gutter_width = !vgrid_gutter)
7
+ :width= (!vgrid_width / !cols) * !n - !gutter_width
8
+
9
+ =grid_unit_base(!gutter_width = !vgrid_gutter)
10
+ :display inline
11
+ :float left
12
+ :position relative
13
+ :margin
14
+ :left= !gutter_width / 2
15
+ :right= !gutter_width / 2
16
+
17
+ =grid(!n, !cols = !vgrid_columns, !gutter_width = !vgrid_gutter)
18
+ +grid_unit_base(!gutter_width)
19
+ +grid_width(!n, !cols, !gutter_width)
20
+
21
+ =grids(!cols = !vgrid_columns, !gutter_width = !vgrid_gutter)
22
+ #{enumerate(".grid", 1, !cols, "_")}
23
+ +grid_unit_base
24
+ @for !n from 1 through !cols
25
+ .container_#{!cols} .grid_#{!n}
26
+ +grid_width(!n, !cols, !gutter_width)
27
+
28
+ =grid_prefix(!n, !cols = !vgrid_columns)
29
+ :padding-left= (!vgrid_width / !cols) * !n
30
+
31
+ =grid_prefixes(!cols = !vgrid_columns)
32
+ @for !n from 1 through !cols - 1
33
+ .container_#{!cols} .prefix_#{!n}
34
+ +grid_prefix(!n, !cols)
35
+
36
+ =grid_suffix(!n, !cols = !vgrid_columns)
37
+ :padding-right= (!vgrid_width / !cols) * !n
38
+
39
+ =grid_suffixes(!cols = !vgrid_columns)
40
+ @for !n from 1 through !cols - 1
41
+ .container_#{!cols} .suffix_#{!n}
42
+ +grid_suffix(!n, !cols)
43
+
44
+ =grid_push(!n, !cols = !vgrid_columns)
45
+ :left= (!vgrid_width / !cols) * !n
46
+
47
+ =grid_pushes(!cols = !vgrid_columns)
48
+ @for !n from 1 through !cols - 1
49
+ .container_#{!cols} .push_#{!n}
50
+ +grid_push(!n, !cols)
51
+
52
+ =grid_pull(!n, !cols = !vgrid_columns)
53
+ :right= (!vgrid_width / !cols) * !n * -1
54
+
55
+ =grid_pulls(!cols = !vgrid_columns)
56
+ @for !n from 1 through !cols - 1
57
+ .container_#{!cols} .pull_#{!n}
58
+ +grid_pull(!n, !cols)
59
+
60
+ @import vgrid/shared/grid_system.sass
@@ -0,0 +1,60 @@
1
+ =grid_container
2
+ :margin-left 4%
3
+ :margin-right 4%
4
+ :width= 92%
5
+
6
+ =grid_width(!n, !cols = !vgrid_columns)
7
+ :width= (100% / !cols) * !n - 2%
8
+
9
+ =grid_unit_base
10
+ :display inline
11
+ :float left
12
+ :position relative
13
+ :margin
14
+ :left= 1%
15
+ :right= 1%
16
+
17
+ =grid(!n, !cols = !vgrid_columns)
18
+ +grid_unit_base
19
+ +grid_width(!n, !cols)
20
+
21
+ =grids(!cols = !vgrid_columns)
22
+ #{enumerate(".grid", 1, !cols, "_")}
23
+ +grid_unit_base
24
+ @for !n from 1 through !cols
25
+ .container_#{!cols} .grid_#{!n}
26
+ +grid_width(!n, !cols)
27
+
28
+ =grid_prefix(!n, !cols = !vgrid_columns)
29
+ :padding-left= (100% / !cols) * !n
30
+
31
+ =grid_prefixes(!cols = !vgrid_columns)
32
+ @for !n from 1 through !cols - 1
33
+ .container_#{!cols} .prefix_#{!n}
34
+ +grid_prefix(!n, !cols)
35
+
36
+ =grid_suffix(!n, !cols = !vgrid_columns)
37
+ :padding-right= (100% / !cols) * !n
38
+
39
+ =grid_suffixes(!cols = !vgrid_columns)
40
+ @for !n from 1 through !cols - 1
41
+ .container_#{!cols} .suffix_#{!n}
42
+ +grid_suffix(!n, !cols)
43
+
44
+ =grid_push(!n, !cols = !vgrid_columns)
45
+ :left= (100% / !cols) * !n
46
+
47
+ =grid_pushes(!cols = !vgrid_columns)
48
+ @for !n from 1 through !cols - 1
49
+ .container_#{!cols} .push_#{!n}
50
+ +grid_push(!n, !cols)
51
+
52
+ =grid_pull(!n, !cols = !vgrid_columns)
53
+ :right= (100% / !cols) * !n * -1
54
+
55
+ =grid_pulls(!cols = !vgrid_columns)
56
+ @for !n from 1 through !cols - 1
57
+ .container_#{!cols} .pull_#{!n}
58
+ +grid_pull(!n, !cols)
59
+
60
+ @import vgrid/shared/grid_system.sass
@@ -0,0 +1,45 @@
1
+ @import compass/utilities/general/clearfix.sass
2
+
3
+ !vgrid_width ||= 960px
4
+ !vgrid_columns ||= 12
5
+ !vgrid_gutter ||= 20px
6
+
7
+ =alpha
8
+ :margin-left 0
9
+
10
+ =omega
11
+ :margin-right 0
12
+
13
+ =grid_children
14
+ .alpha
15
+ +alpha
16
+ .omega
17
+ +omega
18
+
19
+ =grid_system(!cols = !vgrid_columns)
20
+ /*
21
+ Containers
22
+ .container_#{!cols}
23
+ +grid_container
24
+ /*
25
+ Grid
26
+ +grids(!cols)
27
+ /*
28
+ Grid >> Children (Alpha ~ First, Omega ~ Last)
29
+ +grid_children
30
+ /*
31
+ Prefix Extra Space
32
+ +grid_prefixes(!cols)
33
+ /*
34
+ Suffix Extra Space
35
+ +grid_suffixes(!cols)
36
+ /*
37
+ Push Space
38
+ +grid_pushes(!cols)
39
+ /*
40
+ Pull Space
41
+ +grid_pulls(!cols)
42
+ /*
43
+ Clear Floated Elements
44
+ .clearfix
45
+ +clearfix
@@ -0,0 +1,2 @@
1
+ /*
2
+ The vGrid Elastic framework is still in development. Look out for version 0.3.
@@ -0,0 +1 @@
1
+ stylesheet "grid.sass", :media => "screen, projection"
@@ -0,0 +1,25 @@
1
+ /*
2
+ Variable Grid System.
3
+ Learn more ~ http://www.spry-soft.com/grids/
4
+ Based on 960 Grid System - http://960.gs/
5
+ Licensed under GPL and MIT.
6
+ Converted to Compass compatible plugin by Aaron Russell - http://www.aaronrussell.co.uk
7
+
8
+ @import vgrid/fixed.sass
9
+
10
+ // The following generates the default grids provided by the css version of Variable Grid System
11
+ +grid_system(12)
12
+
13
+ // But most compass users prefer to construct semantic layouts like so (two column layout with header and footer):
14
+ !vgrid_columns = 16
15
+ #wrap
16
+ +grid_container
17
+ #header, #footer
18
+ +grid(16)
19
+ #left-nav
20
+ +grid(5)
21
+ #main-content
22
+ +grid_prefix(1)
23
+ +grid(10)
24
+
25
+ // When in doubt, try a +clearfix mixin ;)
@@ -0,0 +1 @@
1
+ stylesheet "grid.sass", :media => "screen, projection"
@@ -0,0 +1,25 @@
1
+ /*
2
+ Variable Grid System (Fluid Version).
3
+ Learn more ~ http://www.spry-soft.com/grids/
4
+ Based on 960 Grid System - http://960.gs/ & 960 Fluid - http://www.designinfluences.com/
5
+ Licensed under GPL and MIT.
6
+ Converted to Compass compatible plugin by Aaron Russell - http://www.aaronrussell.co.uk
7
+
8
+ @import vgrid/fluid.sass
9
+
10
+ // The following generates the default grids provided by the css version of Variable Grid System
11
+ +grid_system(12)
12
+
13
+ // But most compass users prefer to construct semantic layouts like so (two column layout with header and footer):
14
+ !vgrid_columns = 16
15
+ #wrap
16
+ +grid_container
17
+ #header, #footer
18
+ +grid(16)
19
+ #left-nav
20
+ +grid(5)
21
+ #main-content
22
+ +grid_prefix(1)
23
+ +grid(10)
24
+
25
+ // When in doubt, try a +clearfix mixin ;)
@@ -0,0 +1 @@
1
+ stylesheet "grid.sass", :media => "screen, projection"
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: compass-vgrid-plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Aaron Russell
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-10 00:00:00 +00: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"
24
+ version:
25
+ description: A Compass compatible SASS port of the Variable Grid System by Spry Soft (http://www.spry-soft.com/grids/). Based in the 960 Grid System (http://960.gs/). Provides fixed, fluid and elastic grids with complete control over the grid system.
26
+ email: aaron@gc4.co.uk
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.md
34
+ files:
35
+ - .document
36
+ - .gitignore
37
+ - LICENSE
38
+ - README.md
39
+ - Rakefile
40
+ - VERSION
41
+ - compass-vgrid-plugin.gemspec
42
+ - lib/vgrid.rb
43
+ - lib/vgrid/compass_plugin.rb
44
+ - sass/vgrid/_elastic.sass
45
+ - sass/vgrid/_fixed.sass
46
+ - sass/vgrid/_fluid.sass
47
+ - sass/vgrid/shared/_grid_system.sass
48
+ - templates/elastic/project/grid.sass
49
+ - templates/elastic/project/manifest.rb
50
+ - templates/fixed/project/grid.sass
51
+ - templates/fixed/project/manifest.rb
52
+ - templates/fluid/project/grid.sass
53
+ - templates/fluid/project/manifest.rb
54
+ has_rdoc: true
55
+ homepage: http://github.com/aaronrussell/compass-vgrid-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
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ requirements: []
76
+
77
+ rubyforge_project:
78
+ rubygems_version: 1.3.5
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Compass compatible SASS port of the Variable Grid System. Based on the 960 Grid System.
82
+ test_files: []
83
+