compass-scalablegs-plugin 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +92 -0
- data/compass-scalablegs-plugin.gemspec +27 -0
- data/lib/scalablegs.rb +2 -0
- data/stylesheets/scalablegs/_grid.sass +102 -0
- data/templates/project/manifest.rb +16 -0
- data/templates/project/scalablegs.sass +30 -0
- metadata +72 -0
data/README.md
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# Scalable Grid System - Compass Plugin
|
2
|
+
|
3
|
+
|
4
|
+
Scalable.gs is a cross screen size and device CSS framework. Check out the [Scalable.gs](http://scalable.gs/) website for more information and use cases.
|
5
|
+
|
6
|
+
* This plugin is consistent with latest version of scalable.gs as of 4/5/2011
|
7
|
+
|
8
|
+
____
|
9
|
+
|
10
|
+
This plugin adds the Scalable Grid System framework to [Compass](http://compass-style.org/).
|
11
|
+
|
12
|
+
The plugin is build upon the great work done by [Christopher M. Eppstein and Matt Sanders with the 960 Grid System framework compass plugin](https://github.com/chriseppstein/compass-960-plugin). The framework follows some of the name convention from the [960.gs by Nathan Smith](http://960.gs).
|
13
|
+
|
14
|
+
#Install
|
15
|
+
|
16
|
+
|
17
|
+
gem install compass-scalablegs-plugin
|
18
|
+
|
19
|
+
##Create a 960-based Compass Project
|
20
|
+
|
21
|
+
|
22
|
+
compass create -r scalablegs my_project --using scalablegs
|
23
|
+
|
24
|
+
Or, If you prefer to use Sass's indentation based syntax:
|
25
|
+
|
26
|
+
compass create -r scalablegs my_project --using scalablegs --syntax sass
|
27
|
+
|
28
|
+
Then edit your `scalablegs.sass` accordingly.
|
29
|
+
|
30
|
+
# Customising your Grid System
|
31
|
+
|
32
|
+
|
33
|
+
This plugin uses the following configuration variables:
|
34
|
+
|
35
|
+
* `$scalablegs-columns` (default: 20) controls the default number of grid columns
|
36
|
+
* `$scalablegs-grid-min-width` (default: 26em - with the assumption of a 12px body font size) controls the default minimum site width
|
37
|
+
* `$scalablegs-grid-max-width` (default: 82em - with the assumption of a 12px body font size) controls the default maximum site width
|
38
|
+
* `$scalablegs-gutter-width` (default: 2%) controls the default gutter width
|
39
|
+
|
40
|
+
All of the mixins included with this plugin use these configuration variables
|
41
|
+
as defaults if the corresponding argument is omitted from a mixin call.
|
42
|
+
|
43
|
+
# Class-Based Grid System
|
44
|
+
|
45
|
+
|
46
|
+
To create a grid system that works like the original Scalable.gs framework
|
47
|
+
use the `+grid-system` mixin to generate the corresponding classes. You can
|
48
|
+
also customize the number of columns as demonstrated in the following example.
|
49
|
+
|
50
|
+
Example:
|
51
|
+
|
52
|
+
#wrap
|
53
|
+
+grid-system(24)
|
54
|
+
|
55
|
+
# Making Semantic Grids
|
56
|
+
|
57
|
+
|
58
|
+
To create a grid system using only CSS, use the following semantic grid mixins:
|
59
|
+
|
60
|
+
* Use the `+grid-container` mixin to declare your container element.
|
61
|
+
* Use the `+grid(N, columns, gutter-width)` mixin to declare a grid element.
|
62
|
+
* Use the `+first` and `+last` mixins to declare the first and last grid elements for a row.
|
63
|
+
* Use the `+grid-prefix(N, columns)` and `+grid-suffix(N, columns)` mixins to add empty grid columns before or after a grid element.
|
64
|
+
* Use the `+grid-push(N, columns)` and `+grid-pull(N, columns)` mixins to move a grid element from its default position.
|
65
|
+
|
66
|
+
`N` is the number of grid columns to span as in `grid_N` or `push_N` with the original 960 Grid System framework.
|
67
|
+
|
68
|
+
Example:
|
69
|
+
|
70
|
+
$scalablegs-columns: 24
|
71
|
+
|
72
|
+
#wrap
|
73
|
+
+grid-container
|
74
|
+
#left-nav
|
75
|
+
+alpha
|
76
|
+
+grid(5)
|
77
|
+
#main-content
|
78
|
+
+grid-prefix(1)
|
79
|
+
+grid(10)
|
80
|
+
+omega
|
81
|
+
|
82
|
+
# Authors/Contributors
|
83
|
+
|
84
|
+
[Chris Eppstein](http://chriseppstein.github.com/) is the creator of Compass, a core contributor to Sass and the father of this plugin.
|
85
|
+
|
86
|
+
[Nathan Smith](http://sonspring.com/) is the author of [960.gs](http://960.gs/), the grid system this plugin is based on. He's also kind enough to let us pester him with questions from time to time.
|
87
|
+
|
88
|
+
[Matt Sanders](https://github.com/mattsa) is probably the best go to person if you want more information about the original compass-960-plugin.
|
89
|
+
|
90
|
+
[Kenneth Nordahl](https://github.com/kdn) forked and then converted the original plugin over to the [Scalable Grid System](http://scalable.gs).
|
91
|
+
|
92
|
+
[Other contributors](https://github.com/KDN/compass-scalablegs-plugin/contributors) have worked on original fork of this plugin.
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{compass-scalablegs-plugin}
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
|
8
|
+
s.authors = ["Chris Eppstein", "Matt Sanders", "Kenneth Nordahl"]
|
9
|
+
s.date = %q{2011-04-05}
|
10
|
+
s.description = %q{The Scalable Grid System or scalable.gs for short, is a device independent and cross screen size CSS framework.}
|
11
|
+
s.email = %w{kenneth@nordahl.me}
|
12
|
+
s.has_rdoc = false
|
13
|
+
s.files = [
|
14
|
+
"compass-scalablegs-plugin.gemspec",
|
15
|
+
"README.md",
|
16
|
+
"lib/scalablegs.rb",
|
17
|
+
"stylesheets/scalablegs/_grid.sass",
|
18
|
+
"templates/project/scalablegs.sass",
|
19
|
+
"templates/project/manifest.rb"
|
20
|
+
]
|
21
|
+
s.homepage = %q{http://github.com/KDN/compass-scalablegs-plugin}
|
22
|
+
s.require_paths = ["lib"]
|
23
|
+
s.rubyforge_project = %q{compass-scalablegs-plugin}
|
24
|
+
s.rubygems_version = %q{1.3.6}
|
25
|
+
s.summary = %q{Compass compatible Sass port of scalable.gs.}
|
26
|
+
s.add_dependency(%q<compass>, [">= 0.10.0"])
|
27
|
+
end
|
data/lib/scalablegs.rb
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# Config defaults
|
2
|
+
$scalablegs-gutter-width: 2\% !default
|
3
|
+
|
4
|
+
$scalablegs-grid-min-width: 26em !default
|
5
|
+
|
6
|
+
$scalablegs-grid-max-width: 82em !default
|
7
|
+
|
8
|
+
$scalablegs-grid-width: 100% !default
|
9
|
+
|
10
|
+
$scalablegs-columns: 20 !default
|
11
|
+
|
12
|
+
|
13
|
+
=grid-container
|
14
|
+
margin-left: auto
|
15
|
+
margin-right: auto
|
16
|
+
min-width: $scalablegs-grid-min-width
|
17
|
+
max-width: $scalablegs-grid-max-width
|
18
|
+
position: relative
|
19
|
+
|
20
|
+
=grid-width($n, $cols: $scalablegs-columns, $gutter-width: $scalablegs-gutter-width)
|
21
|
+
width: $scalablegs-grid-width / $cols * $n - $gutter-width
|
22
|
+
|
23
|
+
=grid-unit-base($gutter-width: $scalablegs-gutter-width)
|
24
|
+
display: inline
|
25
|
+
float: left
|
26
|
+
margin:
|
27
|
+
left: $gutter-width / 2
|
28
|
+
right: $gutter-width / 2
|
29
|
+
|
30
|
+
=grid($n, $cols: $scalablegs-columns, $gutter-width: $scalablegs-gutter-width)
|
31
|
+
+grid-unit-base($gutter-width)
|
32
|
+
+grid-width($n, $cols, $gutter-width)
|
33
|
+
|
34
|
+
=grid-first
|
35
|
+
margin-left: 0
|
36
|
+
|
37
|
+
=grid-last
|
38
|
+
margin-right: 0
|
39
|
+
|
40
|
+
=grids($cols: $scalablegs-columns, $gutter-width: $scalablegs-gutter-width)
|
41
|
+
#{enumerate(".grid", 1, $cols, "_")}
|
42
|
+
+grid-unit-base
|
43
|
+
@for $n from 1 through $cols
|
44
|
+
.grid_#{$n}
|
45
|
+
+grid-width($n, $cols, $gutter-width)
|
46
|
+
|
47
|
+
=grid-prefix($n, $cols: $scalablegs-columns)
|
48
|
+
padding-left: $scalablegs-grid-width / $cols * $n
|
49
|
+
|
50
|
+
=grid-prefixes($cols: $scalablegs-columns)
|
51
|
+
@for $n from 1 through $cols - 1
|
52
|
+
.prefix_#{$n}
|
53
|
+
+grid-prefix($n, $cols)
|
54
|
+
|
55
|
+
=grid-suffix($n, $cols: $scalablegs-columns)
|
56
|
+
padding-right: $scalablegs-grid-width / $cols * $n
|
57
|
+
|
58
|
+
=grid-suffixes($cols: $scalablegs-columns)
|
59
|
+
@for $n from 1 through $cols - 1
|
60
|
+
.suffix_#{$n}
|
61
|
+
+grid-suffix($n, $cols)
|
62
|
+
|
63
|
+
=grid-children
|
64
|
+
.first
|
65
|
+
+first
|
66
|
+
.last
|
67
|
+
+last
|
68
|
+
|
69
|
+
=grid-move-base
|
70
|
+
position: relative
|
71
|
+
|
72
|
+
=grid-move-push($n, $cols)
|
73
|
+
left: ($scalablegs-grid-width / $cols) * $n
|
74
|
+
|
75
|
+
=grid-move-pull($n, $cols)
|
76
|
+
left: -($scalablegs-grid-width / $cols) * $n
|
77
|
+
|
78
|
+
=grid-push($n, $cols: $scalablegs-columns)
|
79
|
+
+grid-move-base
|
80
|
+
+grid-move-push($n, $cols)
|
81
|
+
|
82
|
+
=grid-pull($n, $cols: $scalablegs-columns)
|
83
|
+
+grid-move-base
|
84
|
+
+grid-move-pull($n, $cols)
|
85
|
+
|
86
|
+
=grid-movements($cols: $scalablegs-columns)
|
87
|
+
#{enumerate(".push", 1, $cols, "_")},
|
88
|
+
#{enumerate(".pull", 1, $cols, "_")}
|
89
|
+
+grid-move-base
|
90
|
+
@for $n from 1 through $cols
|
91
|
+
.push_#{$n}
|
92
|
+
+grid-move-push($n, $cols)
|
93
|
+
.pull_#{$n}
|
94
|
+
+grid-move-pull($n, $cols)
|
95
|
+
|
96
|
+
=grid-system($cols: $scalablegs-columns)
|
97
|
+
+grid-container
|
98
|
+
+grids($cols)
|
99
|
+
+grid-prefixes($cols)
|
100
|
+
+grid-suffixes($cols)
|
101
|
+
+grid-children
|
102
|
+
+grid-movements($cols)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
stylesheet 'scalablegs.sass', :media => "screen, projection"
|
2
|
+
|
3
|
+
description "Scalable Grid System for cross device and screen size web development."
|
4
|
+
|
5
|
+
help %Q{
|
6
|
+
Please see the Scalable.gs website for documentation:
|
7
|
+
|
8
|
+
http://scalable.gs/
|
9
|
+
}
|
10
|
+
|
11
|
+
welcome_message %Q{
|
12
|
+
Please see the Scalable.gs website for documentation:
|
13
|
+
|
14
|
+
http://scalable.gs/
|
15
|
+
}
|
16
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
/* Scalable Grid System ~ Core CSS.
|
2
|
+
* Learn more ~ http://scalable.gs/
|
3
|
+
* *
|
4
|
+
* Licensed under GPL and MIT.
|
5
|
+
|
6
|
+
|
7
|
+
@import scalablegs/grid
|
8
|
+
|
9
|
+
// The following generates the default grids provided by the css version of 960.gs
|
10
|
+
.scalablegs
|
11
|
+
+grid-system(20)
|
12
|
+
|
13
|
+
|
14
|
+
// But most compass users prefer to construct semantic layouts like so (two column layout with header and footer):
|
15
|
+
|
16
|
+
$scalablegs-columns: 20
|
17
|
+
|
18
|
+
.two-column
|
19
|
+
+grid-scalable
|
20
|
+
#header,
|
21
|
+
#footer,
|
22
|
+
#sidebar,
|
23
|
+
#main-content
|
24
|
+
+grid-unit-base
|
25
|
+
#header, #footer
|
26
|
+
+grid-width(20)
|
27
|
+
#sidebar
|
28
|
+
+grid-width(6)
|
29
|
+
#main-content
|
30
|
+
+grid-width(14)
|
metadata
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: compass-scalablegs-plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.0.1
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Eppstein
|
9
|
+
- Matt Sanders
|
10
|
+
- Kenneth Nordahl
|
11
|
+
autorequire:
|
12
|
+
bindir: bin
|
13
|
+
cert_chain: []
|
14
|
+
|
15
|
+
date: 2011-04-05 00:00:00 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: compass
|
19
|
+
prerelease: false
|
20
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
|
+
none: false
|
22
|
+
requirements:
|
23
|
+
- - ">="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 0.10.0
|
26
|
+
type: :runtime
|
27
|
+
version_requirements: *id001
|
28
|
+
description: The Scalable Grid System or scalable.gs for short, is a device independent and cross screen size CSS framework.
|
29
|
+
email:
|
30
|
+
- kenneth@nordahl.me
|
31
|
+
executables: []
|
32
|
+
|
33
|
+
extensions: []
|
34
|
+
|
35
|
+
extra_rdoc_files: []
|
36
|
+
|
37
|
+
files:
|
38
|
+
- compass-scalablegs-plugin.gemspec
|
39
|
+
- README.md
|
40
|
+
- lib/scalablegs.rb
|
41
|
+
- stylesheets/scalablegs/_grid.sass
|
42
|
+
- templates/project/scalablegs.sass
|
43
|
+
- templates/project/manifest.rb
|
44
|
+
homepage: http://github.com/KDN/compass-scalablegs-plugin
|
45
|
+
licenses: []
|
46
|
+
|
47
|
+
post_install_message:
|
48
|
+
rdoc_options: []
|
49
|
+
|
50
|
+
require_paths:
|
51
|
+
- lib
|
52
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.3.5
|
64
|
+
requirements: []
|
65
|
+
|
66
|
+
rubyforge_project: compass-scalablegs-plugin
|
67
|
+
rubygems_version: 1.7.1
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Compass compatible Sass port of scalable.gs.
|
71
|
+
test_files: []
|
72
|
+
|