semantic_grid 0.1

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/.gitignore ADDED
@@ -0,0 +1,6 @@
1
+ *swp
2
+ *gem
3
+ .sass-cache/
4
+ semantic_grid/
5
+ demo/
6
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sass-mixins.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2011 thoughtbot, inc.
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,126 @@
1
+ // Semantic SASS Grid
2
+ //
3
+ // A 16-column semantic grid for SASS adapted from:
4
+
5
+ // 960 Grid System ~ Core CSS.
6
+ // Learn more ~ http://960.gs/
7
+ //
8
+ // Licensed under GPL and MIT.
9
+ //
10
+ //
11
+
12
+
13
+
14
+ // Core classes
15
+
16
+ @mixin grid-core {
17
+ display: inline;
18
+ float: left;
19
+ margin-left: 10px;
20
+ margin-right: 10px;
21
+ }
22
+
23
+ @mixin clearfix-base {
24
+ content: '.';
25
+ display: block;
26
+ overflow: hidden;
27
+ visibility: hidden;
28
+ font-size: 0;
29
+ line-height: 0;
30
+ width: 0;
31
+ height: 0;
32
+ }
33
+
34
+
35
+ // Body
36
+ @mixin body {
37
+ min-width: 960px;
38
+ }
39
+
40
+ // Container
41
+
42
+ @mixin grid-container {
43
+ margin-left: auto;
44
+ margin-right: auto;
45
+ width: 960px;
46
+ zoom: 1;
47
+ &:before {
48
+ @include clearfix-base;
49
+ }
50
+ &:after {
51
+ @include clearfix-base;
52
+ clear: both;
53
+ }
54
+ }
55
+
56
+
57
+ // Clear Floated Elements
58
+
59
+ @mixin clear {
60
+ clear: both;
61
+ display: block;
62
+ overflow: hidden;
63
+ visibility: hidden;
64
+ width: 0;
65
+ height: 0;
66
+ }
67
+
68
+
69
+ // Clearfix
70
+
71
+ @mixin clearfix {
72
+ zoom: 1;
73
+ &:before {
74
+ @include clearfix-base;
75
+ }
76
+ &:after {
77
+ @include clearfix-base;
78
+ clear: both;
79
+ }
80
+ }
81
+
82
+
83
+
84
+ // Grid >> Global
85
+
86
+ @mixin grid($columns) {
87
+ @include grid-core;
88
+ @if $columns == 1 {
89
+ width: 40px;
90
+ }
91
+ @else {
92
+ width: 40px = 60px * ($columns - 1)
93
+ }
94
+ }
95
+
96
+
97
+ @mixin push($columns) {
98
+ position: relative;
99
+ left: 60px * $columns;
100
+ }
101
+
102
+ @mixin pull($columns) {
103
+ position: relative;
104
+ left: -60px * $columns;
105
+ }
106
+
107
+ @mixin prefix($columns) {
108
+ padding-left: 60px * $columns;
109
+ }
110
+
111
+ @mixin suffix($columns) {
112
+ padding-right: 60px * $columns;
113
+ }
114
+
115
+
116
+ // Grid >> Children (Alpha ~ First, Omega ~ Last)
117
+
118
+ @mixin alpha {
119
+ margin-left: 0;
120
+ }
121
+
122
+
123
+ @mixin omega {
124
+ margin-right: 0;
125
+ }
126
+
@@ -0,0 +1,17 @@
1
+ module SemanticGrid
2
+ if defined?(Rails)
3
+ class Engine < ::Rails::Engine
4
+ require 'semnatic_grid/engine'
5
+ end
6
+
7
+ module Rails
8
+ class Railtie < ::Rails::Railtie
9
+ rake_tasks do
10
+ load "tasks/install.rake"
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+
17
+ require File.join(File.dirname(__FILE__), "/semantic_grid/sass_extensions")
@@ -0,0 +1,5 @@
1
+ module Bourbon
2
+ class Engine < Rails::Engine
3
+ # auto wire
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module Bourbon::SassExtensions
2
+ end
3
+
4
+ require "sass"
@@ -0,0 +1,3 @@
1
+ module SemanticGrid
2
+ VERSION = "0.1"
3
+ end
data/readme.md ADDED
@@ -0,0 +1,79 @@
1
+ #Semantic Grid
2
+
3
+ This is a simple 16-column semantic grid for Sass based on the popular 960.gs.
4
+
5
+ To use the grid, simply mixin in the following:
6
+
7
+ body
8
+ +body
9
+
10
+ // Any element that you wish to user the grid on
11
+ content
12
+ +grid-container
13
+
14
+
15
+ You now have access to all the standard 960 grid features: grid(n), push(n), pull(n), prefix(n), suffix(n).
16
+ Mixin 'alpha' and 'omega' to first and last columns, respectively.
17
+
18
+
19
+ This grid plays nice with [html5-boilerplate](http://html5boilerplate.com/).
20
+
21
+
22
+ #Requirements
23
+ Sass 3.1+
24
+
25
+
26
+ #Install for Rails
27
+ Update your Gemfile
28
+
29
+ gem 'semantic_grid'
30
+
31
+ bundle install
32
+
33
+ ##Rails 3.1.x
34
+ Semantic Grid needs the sass files to be imported in a specific order to function properly—therefore you will need to disabled the require_tree sprocket directive.
35
+ Comment-out the following sprocket directive in /application.css.scss (Remove the =)
36
+
37
+ * require_tree .
38
+
39
+ Import the mixins at the beginning of your stylesheet
40
+
41
+ @import 'semantic_grid';
42
+
43
+
44
+ #Install without Rails
45
+ The following script will generate a *semantic_grid* directory and convert all .css.scss to .scss extensions. The *semantic_grid* directory is for 'sass --watch' use outside of rails.
46
+
47
+ Preliminary step: clone this repo and cd into the directory.
48
+
49
+ **Step 1:** Make script executable by changing file permission
50
+
51
+ chmod a+x generate-semantic_grid.sh
52
+
53
+ **Step 2:** Generate files
54
+
55
+ ./generate-semantic_grid.sh
56
+
57
+ **Step 3:** Move the new *semantic_grid* directory into your project's sass directory. *e.g. stylesheets/sass/*
58
+
59
+ **Step 4:** Semantic Grid requires an additional sass extension to output properly. You must watch your sass files with the following flag appended:
60
+ *-r ./semantic_grid/lib/semantic_grid.rb*
61
+
62
+ # Example (project root directory)
63
+ sass --watch stylesheets/sass:stylesheets -r ./stylesheets/sass/semantic_grid/lib/semantic_grid.rb
64
+
65
+
66
+
67
+ ##Help Out
68
+
69
+ Currently the project is a work in progress. Feel free to help out.
70
+
71
+ Credits
72
+ -------
73
+
74
+ Semantic Grid is maintained and by [Gavin Hughes](http://github.com/gavinhughes)
75
+
76
+ License
77
+ -------
78
+
79
+ Bourbon is Copyright © 2011 Gavin Hughes. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "semantic_grid/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "semantic_grid"
7
+ s.version = SemanticGrid::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Gavin Hughes"]
10
+ s.email = ["g@gavinhughes.net"]
11
+ s.homepage = "https://github.com/gavinhughes/semantic_grid"
12
+ s.summary = "Semantic grid for Sass based on 960.gs."
13
+ s.description = "This is a simple semantic grid for SASS based on the popular 960.gs."
14
+
15
+ s.rubyforge_project = "semantic_grid"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_dependency('sass', '>= 3.1')
23
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: semantic_grid
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Gavin Hughes
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2011-09-03 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: &70265279779680 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '3.1'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70265279779680
25
+ description: This is a simple semantic grid for SASS based on the popular 960.gs.
26
+ email:
27
+ - g@gavinhughes.net
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files: []
31
+ files:
32
+ - .gitignore
33
+ - Gemfile
34
+ - LICENSE
35
+ - Rakefile
36
+ - app/assets/stylesheets/_semantic_grid.scss
37
+ - lib/semantic_grid.rb
38
+ - lib/semantic_grid/engine.rb
39
+ - lib/semantic_grid/sass_extensions.rb
40
+ - lib/semantic_grid/version.rb
41
+ - readme.md
42
+ - semantic_grid.gemspec
43
+ homepage: https://github.com/gavinhughes/semantic_grid
44
+ licenses: []
45
+ post_install_message:
46
+ rdoc_options: []
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ requirements: []
62
+ rubyforge_project: semantic_grid
63
+ rubygems_version: 1.8.6
64
+ signing_key:
65
+ specification_version: 3
66
+ summary: Semantic grid for Sass based on 960.gs.
67
+ test_files: []