compass-1024-plugin 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.mkdn +108 -0
- data/compass-1024-plugin.gemspec +29 -0
- data/lib/tentwentyfour.rb +2 -0
- data/stylesheets/1024/_grid.sass +100 -0
- data/stylesheets/1024/_text.sass +47 -0
- data/templates/project/grid.sass +12 -0
- data/templates/project/manifest.rb +19 -0
- data/templates/project/text.sass +7 -0
- metadata +71 -0
data/README.mkdn
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
1024 Grid System - Compass Plugin
|
2
|
+
================================
|
3
|
+
|
4
|
+
|
5
|
+
---------
|
6
|
+
|
7
|
+
This plugin adds the 1024 Grid System framework to [Compass](http://compass-style.org/).
|
8
|
+
|
9
|
+
Install
|
10
|
+
=======
|
11
|
+
|
12
|
+
gem install compass-1024-plugin
|
13
|
+
|
14
|
+
Create a 1024-based Compass Project
|
15
|
+
==================================
|
16
|
+
|
17
|
+
compass create -r tentwentyfour my_project --using 1024
|
18
|
+
|
19
|
+
Or, If you prefer to use Sass's indentation based syntax:
|
20
|
+
|
21
|
+
compass create -r tentwentyfour my_project --using 1024 --syntax sass
|
22
|
+
|
23
|
+
Then edit your `grid.sass` and `text.sass` files accordingly. A reset is added into grid.sass automatically.
|
24
|
+
|
25
|
+
Adding the 1024 plugin to an existing project
|
26
|
+
============================================
|
27
|
+
|
28
|
+
Add the following to your compass.rb config file:
|
29
|
+
|
30
|
+
# Require any additional compass plugins here.
|
31
|
+
require 'tentwentyfour'
|
32
|
+
|
33
|
+
Then make sure you have imported the grid library into your core .sass or .scss file with:
|
34
|
+
|
35
|
+
@import compass/reset
|
36
|
+
@import 1024/grid
|
37
|
+
|
38
|
+
Customizing your Grid System
|
39
|
+
============================
|
40
|
+
|
41
|
+
This plugin uses the following configuration variables:
|
42
|
+
|
43
|
+
* `$tentwentyfour-columns` (default: 12) controls the default number of grid columns
|
44
|
+
* `$tentwentyfour-grid-width` (default: 1024px) controls the default overall grid width
|
45
|
+
* `$tentwentyfour-gutter-width` (default: 20px) controls the default gutter width
|
46
|
+
* `$tentwentyfour-class-separator` (default: '_') sets the word separator for classnames generated by +grid-system
|
47
|
+
|
48
|
+
All of the mixins included with this plugin use these configuration variables
|
49
|
+
as defaults if the corresponding argument is omitted from a mixin call.
|
50
|
+
|
51
|
+
Class-Based Grid System
|
52
|
+
=======================
|
53
|
+
|
54
|
+
To create a grid system that works like the original 1024 Grid System framework
|
55
|
+
use the `+grid-system-complete` mixin to generate the corresponding classes. You
|
56
|
+
can also customize the number of columns as demonstrated:
|
57
|
+
|
58
|
+
Example:
|
59
|
+
|
60
|
+
+grid-system-complete(24)
|
61
|
+
|
62
|
+
If you want to scope the grid inside a specific set of selectors or control your container class' name you can use the `+grid-system` mixin instead.
|
63
|
+
|
64
|
+
Example:
|
65
|
+
|
66
|
+
#wrap
|
67
|
+
.my_container
|
68
|
+
+grid-system(16)
|
69
|
+
|
70
|
+
This will render all of the grid system nested below your selector, replacing the normal function of the container class (would be .container_16 in this example).
|
71
|
+
|
72
|
+
Making Semantic Grids
|
73
|
+
=====================
|
74
|
+
|
75
|
+
To create a grid system using only CSS, use the following semantic grid mixins:
|
76
|
+
|
77
|
+
* Use the `+grid-container` mixin to declare your container element.
|
78
|
+
* Use the `+grid(N, columns, gutter-width)` mixin to declare a grid element.
|
79
|
+
* Use the `+alpha` and `+omega` mixins to declare the first and last grid elements for a row.
|
80
|
+
* Use the `+grid-prefix(N, columns)` and `+grid-suffix(N, columns)` mixins to add empty grid columns before or after a grid element.
|
81
|
+
* Use the `+grid-push(N, columns)` and `+grid-pull(N, columns)` mixins to move a grid element from its default position.
|
82
|
+
|
83
|
+
`N` is the number of grid columns to span as in `grid_N` or `push_N` with the original 1024 Grid System framework.
|
84
|
+
|
85
|
+
Example:
|
86
|
+
|
87
|
+
$tentwentyfour-columns: 16
|
88
|
+
|
89
|
+
#wrap
|
90
|
+
+grid-container
|
91
|
+
#header
|
92
|
+
+grid(16)
|
93
|
+
#middle
|
94
|
+
+grid(16)
|
95
|
+
#left-nav
|
96
|
+
+grid(5)
|
97
|
+
+alpha
|
98
|
+
#main-content
|
99
|
+
+grid-prefix(1)
|
100
|
+
+grid(10)
|
101
|
+
+omega
|
102
|
+
|
103
|
+
Authors/Contributors
|
104
|
+
====================
|
105
|
+
|
106
|
+
[Chris Eppstein](http://chriseppstein.github.com/) is the creator of Compass, a core contributor to Sass and the father of this plugin.
|
107
|
+
|
108
|
+
[Jesse Cofie (Maze 0sl0)](http://github.com/bohan3d) is the author of this plugin is based on the 960.gs by Nathan Simth.
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{compass-1024-plugin}
|
5
|
+
s.version = "0.1"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.5")
|
8
|
+
s.authors = ["Jesse Cofie (Maze Oslo)"]
|
9
|
+
s.date = %q{2013-12-09}
|
10
|
+
s.description = %q{The 1024 Grid System is an effort to streamline web development workflow by providing commonly used dimensions, based on a width of 1024 pixels.}
|
11
|
+
s.email = %w{mazeoslo_at_gmail.com bohan3d_at_gmail.com}
|
12
|
+
s.has_rdoc = false
|
13
|
+
s.files = [
|
14
|
+
"compass-1024-plugin.gemspec",
|
15
|
+
"README.mkdn",
|
16
|
+
"lib/tentwentyfour.rb",
|
17
|
+
"stylesheets/1024/_grid.sass",
|
18
|
+
"stylesheets/1024/_text.sass",
|
19
|
+
"templates/project/grid.sass",
|
20
|
+
"templates/project/manifest.rb",
|
21
|
+
"templates/project/text.sass"
|
22
|
+
]
|
23
|
+
s.homepage = %q{http://github.com/bohan3d/compass-1024-plugin}
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
s.rubyforge_project = %q{compass-1024-plugin}
|
26
|
+
s.rubygems_version = %q{1.3.6}
|
27
|
+
s.summary = %q{Compass compatible Sass port of 1024.gs.}
|
28
|
+
s.add_dependency(%q<compass>, [">= 0.1"])
|
29
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
$tentwentyfour-gutter-width: 20px !default
|
2
|
+
|
3
|
+
$tentwentyfour-grid-width: 1024px !default
|
4
|
+
|
5
|
+
$tentwentyfour-columns: 16 !default
|
6
|
+
|
7
|
+
$tentwentyfour-class-separator: "_" !default
|
8
|
+
|
9
|
+
=grid-container
|
10
|
+
margin-left: auto
|
11
|
+
margin-right: auto
|
12
|
+
width: $tentwentyfour-grid-width
|
13
|
+
|
14
|
+
=grid-width($n, $cols: $tentwentyfour-columns, $gutter-width: $tentwentyfour-gutter-width)
|
15
|
+
width: $tentwentyfour-grid-width / $cols * $n - $gutter-width
|
16
|
+
|
17
|
+
=grid-unit-base($gutter-width: $tentwentyfour-gutter-width)
|
18
|
+
display: inline
|
19
|
+
float: left
|
20
|
+
margin:
|
21
|
+
left: $gutter-width / 2
|
22
|
+
right: $gutter-width / 2
|
23
|
+
|
24
|
+
=grid($n, $cols: $tentwentyfour-columns, $gutter-width: $tentwentyfour-gutter-width)
|
25
|
+
+grid-unit-base($gutter-width)
|
26
|
+
+grid-width($n, $cols, $gutter-width)
|
27
|
+
|
28
|
+
=alpha
|
29
|
+
margin-left: 0
|
30
|
+
|
31
|
+
=omega
|
32
|
+
margin-right: 0
|
33
|
+
|
34
|
+
=grids($cols: $tentwentyfour-columns, $gutter-width: $tentwentyfour-gutter-width)
|
35
|
+
#{enumerate(".grid", 1, $cols, $tentwentyfour-class-separator)}
|
36
|
+
+grid-unit-base($gutter-width)
|
37
|
+
@for $n from 1 through $cols
|
38
|
+
.grid#{$tentwentyfour-class-separator}#{$n}
|
39
|
+
+grid-width($n, $cols, $gutter-width)
|
40
|
+
|
41
|
+
=grid-prefix($n, $cols: $tentwentyfour-columns)
|
42
|
+
padding-left: $tentwentyfour-grid-width / $cols * $n
|
43
|
+
|
44
|
+
=grid-prefixes($cols: $tentwentyfour-columns)
|
45
|
+
@for $n from 1 through $cols - 1
|
46
|
+
.prefix#{$tentwentyfour-class-separator}#{$n}
|
47
|
+
+grid-prefix($n, $cols)
|
48
|
+
|
49
|
+
=grid-suffix($n, $cols: $tentwentyfour-columns)
|
50
|
+
padding-right: $tentwentyfour-grid-width / $cols * $n
|
51
|
+
|
52
|
+
=grid-suffixes($cols: $tentwentyfour-columns)
|
53
|
+
@for $n from 1 through $cols - 1
|
54
|
+
.suffix#{$tentwentyfour-class-separator}#{$n}
|
55
|
+
+grid-suffix($n, $cols)
|
56
|
+
|
57
|
+
=grid-children
|
58
|
+
.alpha
|
59
|
+
+alpha
|
60
|
+
.omega
|
61
|
+
+omega
|
62
|
+
|
63
|
+
=grid-move-base
|
64
|
+
position: relative
|
65
|
+
|
66
|
+
=grid-move-push($n, $cols)
|
67
|
+
left: ($tentwentyfour-grid-width / $cols) * $n
|
68
|
+
|
69
|
+
=grid-move-pull($n, $cols)
|
70
|
+
left: -($tentwentyfour-grid-width / $cols) * $n
|
71
|
+
|
72
|
+
=grid-push($n, $cols: $tentwentyfour-columns)
|
73
|
+
+grid-move-base
|
74
|
+
+grid-move-push($n, $cols)
|
75
|
+
|
76
|
+
=grid-pull($n, $cols: $tentwentyfour-columns)
|
77
|
+
+grid-move-base
|
78
|
+
+grid-move-pull($n, $cols)
|
79
|
+
|
80
|
+
=grid-movements($cols: $tentwentyfour-columns)
|
81
|
+
#{enumerate(".push", 1, $cols - 1, $tentwentyfour-class-separator)},
|
82
|
+
#{enumerate(".pull", 1, $cols - 1, $tentwentyfour-class-separator)}
|
83
|
+
+grid-move-base
|
84
|
+
@for $n from 1 through $cols - 1
|
85
|
+
.push#{$tentwentyfour-class-separator}#{$n}
|
86
|
+
+grid-move-push($n, $cols)
|
87
|
+
.pull#{$tentwentyfour-class-separator}#{$n}
|
88
|
+
+grid-move-pull($n, $cols)
|
89
|
+
|
90
|
+
=grid-system($cols: $tentwentyfour-columns)
|
91
|
+
+grid-container
|
92
|
+
+grids($cols)
|
93
|
+
+grid-prefixes($cols)
|
94
|
+
+grid-suffixes($cols)
|
95
|
+
+grid-children
|
96
|
+
+grid-movements($cols)
|
97
|
+
|
98
|
+
=grid-system-complete($cols: $tentwentyfour-columns)
|
99
|
+
.container#{$tentwentyfour-class-separator}#{$cols}
|
100
|
+
+grid-system($cols)
|
@@ -0,0 +1,47 @@
|
|
1
|
+
$tentwentyfour-font-family: unquote("Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif") !default
|
2
|
+
|
3
|
+
=text($font-family: $tentwentyfour-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,19 @@
|
|
1
|
+
stylesheet 'grid.sass', :media => "screen, projection"
|
2
|
+
stylesheet 'text.sass', :media => "screen, projection"
|
3
|
+
|
4
|
+
description "The 1024 Grid System."
|
5
|
+
|
6
|
+
help %Q{
|
7
|
+
No help documentation yet.
|
8
|
+
Please see the following website for documentation related to this grid system:
|
9
|
+
|
10
|
+
http://www.gridsystemgenerator.com/gs03.php?GridWidth=1024&GridColumns=16&GridMarginLeft=10&GridMarginRight=10
|
11
|
+
|
12
|
+
}
|
13
|
+
|
14
|
+
welcome_message %Q{
|
15
|
+
Please see the gridsystemgenerator website for documentation:
|
16
|
+
|
17
|
+
http://www.gridsystemgenerator.com/gs03.php?GridWidth=1024&GridColumns=16&GridMarginLeft=10&GridMarginRight=10
|
18
|
+
}
|
19
|
+
|
metadata
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: compass-1024-plugin
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: '0.1'
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jesse Cofie (Maze Oslo)
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-12-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: compass
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0.1'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0.1'
|
30
|
+
description: The 1024 Grid System is an effort to streamline web development workflow
|
31
|
+
by providing commonly used dimensions, based on a width of 1024 pixels.
|
32
|
+
email:
|
33
|
+
- mazeoslo_at_gmail.com
|
34
|
+
- bohan3d_at_gmail.com
|
35
|
+
executables: []
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files: []
|
38
|
+
files:
|
39
|
+
- compass-1024-plugin.gemspec
|
40
|
+
- README.mkdn
|
41
|
+
- lib/tentwentyfour.rb
|
42
|
+
- stylesheets/1024/_grid.sass
|
43
|
+
- stylesheets/1024/_text.sass
|
44
|
+
- templates/project/grid.sass
|
45
|
+
- templates/project/manifest.rb
|
46
|
+
- templates/project/text.sass
|
47
|
+
homepage: http://github.com/bohan3d/compass-1024-plugin
|
48
|
+
licenses: []
|
49
|
+
post_install_message:
|
50
|
+
rdoc_options: []
|
51
|
+
require_paths:
|
52
|
+
- lib
|
53
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.3.5
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project: compass-1024-plugin
|
67
|
+
rubygems_version: 1.8.24
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Compass compatible Sass port of 1024.gs.
|
71
|
+
test_files: []
|