gridpaper 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/.gitignore +10 -0
  2. data/Gemfile +4 -0
  3. data/Guardfile +33 -0
  4. data/README.rdoc +74 -0
  5. data/Rakefile +10 -0
  6. data/bin/gridpaper +62 -0
  7. data/examples/images/Untitled-1.png +0 -0
  8. data/examples/images/grid.png +0 -0
  9. data/examples/index.html +124 -0
  10. data/examples/stylesheets/sass/_columns.sass +51 -0
  11. data/examples/stylesheets/sass/_settings.sass +7 -0
  12. data/examples/stylesheets/sass/styles.sass +38 -0
  13. data/examples/stylesheets/scss/nested_folder/_imported_file.scss +3 -0
  14. data/examples/stylesheets/scss/nested_folder/generated.scss +0 -0
  15. data/examples/stylesheets/scss/something.scss +1 -0
  16. data/gridpaper.gemspec +26 -0
  17. data/lib/Guardfile +147 -0
  18. data/lib/gridpaper.rb +95 -0
  19. data/lib/gridpaper/version.rb +3 -0
  20. data/lib/guard/gridpaper-watch.rb +129 -0
  21. data/templates/examples/_columns.sass +46 -0
  22. data/templates/sass/_settings.sass +7 -0
  23. data/templates/sass/gridpaper/_all.sass +1 -0
  24. data/templates/sass/gridpaper/_effects.sass +31 -0
  25. data/templates/sass/gridpaper/_forms.sass +27 -0
  26. data/templates/sass/gridpaper/_grid.sass +59 -0
  27. data/templates/sass/gridpaper/_reset.sass +102 -0
  28. data/templates/sass/gridpaper/_utilities.sass +6 -0
  29. data/templates/sass/styles.sass +2 -0
  30. data/templates/scss/_settings.scss +7 -0
  31. data/templates/scss/gridpaper/_all.scss +7 -0
  32. data/templates/scss/gridpaper/_effects.scss +31 -0
  33. data/templates/scss/gridpaper/_forms.scss +19 -0
  34. data/templates/scss/gridpaper/_grid.scss +57 -0
  35. data/templates/scss/gridpaper/_reset.scss +106 -0
  36. data/templates/scss/styles.scss +2 -0
  37. metadata +137 -0
@@ -0,0 +1,10 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
5
+ .DS_Store
6
+ *.sassc
7
+ *.scssc
8
+ .sass-cache
9
+ .scss-cache
10
+ .css
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in gridpaper.gemspec
4
+ gemspec
@@ -0,0 +1,33 @@
1
+ require 'guard/guard'
2
+ require 'colorize'
3
+
4
+ module ::Guard
5
+ class RakeInstall < Guard
6
+ def start
7
+
8
+ end
9
+
10
+ def stop
11
+
12
+ end
13
+
14
+ def reload
15
+ stop
16
+ start
17
+ end
18
+
19
+ def run_all
20
+ true
21
+ end
22
+
23
+ def run_on_change(paths)
24
+ `rake install`
25
+ end
26
+
27
+ end
28
+ end
29
+
30
+ # Available options: :pidfile, :port, :executable
31
+ guard 'rake-install' do
32
+ watch %r{.+}
33
+ end
@@ -0,0 +1,74 @@
1
+ = Gridpaper - A CSS Framework Build On Top of SASS
2
+
3
+ Gridpaper is a simple SASS framework which puts to work some of the nifty features of SASS in a set of pre-build mixins.
4
+
5
+ == Use
6
+
7
+ === Install
8
+
9
+ gem install gridpaper
10
+
11
+ === Generate
12
+
13
+ cd /path/to/project
14
+ gridpaper generate
15
+
16
+ The <tt>gridpaper generate</tt> command is also aliased to:
17
+ gridpaper g
18
+ gridpaper new
19
+ gridpaper setup
20
+ gridpaper add
21
+
22
+ === Options
23
+
24
+ The <tt>gridpaper</tt> command takes the following options
25
+
26
+ --scss
27
+ # Use SCSS syntax (default is SASS)
28
+
29
+ --stylesheets-dir STRING
30
+ # the name of your stylesheets directory (default is "stylesheets")
31
+
32
+ == Development
33
+
34
+ === Changelog
35
+
36
+ - Nov 23, 2011 - Versioned to 0.0.4
37
+ - Nov 23, 2011 - Versioned to 0.0.3
38
+ - Nov 23, 2011 - Basic generator is functional, two syntaxes available: SASS and SCSS
39
+
40
+ === TODO
41
+
42
+ - Flesh out the framework
43
+ - Documentation
44
+ - Examples
45
+
46
+ ---
47
+
48
+ === Contribute
49
+
50
+ Feel free to fork and change!
51
+
52
+ ---
53
+
54
+ === License (MIT)
55
+
56
+ Copyright (C) 2011 by Christian Naths
57
+
58
+ Permission is hereby granted, free of charge, to any person obtaining a copy
59
+ of this software and associated documentation files (the "Software"), to deal
60
+ in the Software without restriction, including without limitation the rights
61
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
62
+ copies of the Software, and to permit persons to whom the Software is
63
+ furnished to do so, subject to the following conditions:
64
+
65
+ The above copyright notice and this permission notice shall be included in
66
+ all copies or substantial portions of the Software.
67
+
68
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
69
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
70
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
71
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
72
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
73
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
74
+ THE SOFTWARE.
@@ -0,0 +1,10 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'fileutils'
3
+ require 'colorize'
4
+
5
+ desc "Build SCSS templates"
6
+ task 'convert' do
7
+ FileUtils.mkdir("scss") unless File.exists?("templates/scss")
8
+ `sass-convert -R templates/sass templates/scss --from sass --to scss --unix-newlines`
9
+ puts "templates converted to SCSS in 'templates/scss'".green
10
+ end
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.dirname(__FILE__) + '/../lib/gridpaper'
4
+
5
+
6
+ # :name is optional, otherwise uses the basename of this executable
7
+ program :name, 'Gridpaper'
8
+ program :version, Gridpaper::VERSION
9
+ program :description, 'A CSS Framework Built On Top of SASS'
10
+
11
+
12
+ command :generate do |c|
13
+ # Describe this command
14
+ c.syntax = 'gridpaper generate <path>'
15
+ c.description = 'Creates a new gridpaper project'
16
+
17
+ # options
18
+ c.option '--scss', 'Use the alternate SCSS sytnax'
19
+ c.option '--stylesheets-dir STRING', String, 'Use a different directory to hold your stylesheets'
20
+
21
+ c.action do |args, options|
22
+ path = args[0] || "."
23
+ options.scss ? syntax = :scss : syntax = :sass
24
+ stylesheets_dir = options.stylesheets_dir || "stylesheets"
25
+ puts stylesheets_dir
26
+
27
+ Gridpaper::Generate.new(path, stylesheets_dir, syntax)
28
+ end
29
+
30
+ end
31
+
32
+ command :watch do |c|
33
+ c.syntax = 'gridpaper watch'
34
+ c.description = 'Watches for changes in your input file and generates CSS to your output file.'
35
+
36
+ # c.option '--stylesheets-dir STRING', String, 'Use a different directory to hold your stylesheets'
37
+
38
+ c.action do |args, options|
39
+ stylesheets_dir = options.stylesheets_dir || "stylesheets"
40
+ # working_path = Dir.pwd
41
+
42
+ input_path = args[0] || "stylesheets/sass"
43
+ # input_path = File.expand_path File.join(working_path, input_path)
44
+ output_path = args[1] || "../stylesheets"
45
+ # output_path = File.expand_path File.join(working_path, output_path)
46
+
47
+ Gridpaper::Watch.new(input_path, output_path)
48
+ end
49
+
50
+ end
51
+
52
+ def check_input_path(working_path)
53
+ unless File.exists?(File.join(working_path, 'sass')) || File.exists?(File.join(working_path, 'scss'))
54
+ puts "Could not find a directory named './#{ stylesheets_dir }/sass' or './#{ stylesheets_dir }/scss'. Aborting.".red
55
+ return false
56
+ end
57
+ end
58
+
59
+ alias_command :g, :generate
60
+ alias_command :new, :generate
61
+ alias_command :setup, :generate
62
+ alias_command :add, :generate
Binary file
@@ -0,0 +1,124 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Gridpaper</title>
5
+ <link rel="stylesheet" type="text/css" href="stylesheets/styles.css" />
6
+ </head>
7
+ <body>
8
+
9
+ <header>
10
+ <h1>Gridpaper</h1>
11
+ </header>
12
+
13
+ <div id="content">
14
+
15
+ <section id="headers">
16
+ <h4>Headers</h4>
17
+ <hgroup>
18
+ <h1>1st Header</h1>
19
+ <h2>2nd Header</h2>
20
+ <h3>3rd Header</h3>
21
+ <h4>4th Header</h4>
22
+ <h5>5th Header</h5>
23
+ <h6>6th Header</h6>
24
+ </hgroup>
25
+ </section>
26
+
27
+
28
+ <section id="columns-example">
29
+ <h4>Grid Columns</h4>
30
+
31
+ <div id="two-columns" class="row">
32
+ <div class="grid-column"></div>
33
+ <div class="grid-column"></div>
34
+ </div>
35
+
36
+ <div id="three-columns" class="row">
37
+ <div class="grid-column"></div>
38
+ <div class="grid-column"></div>
39
+ <div class="grid-column"></div>
40
+ </div>
41
+
42
+ <div id="four-columns" class="row">
43
+ <div class="grid-column"></div>
44
+ <div class="grid-column"></div>
45
+ <div class="grid-column"></div>
46
+ <div class="grid-column"></div>
47
+ </div>
48
+
49
+ <div id="six-columns" class="row">
50
+ <div class="grid-column"></div>
51
+ <div class="grid-column"></div>
52
+ <div class="grid-column"></div>
53
+ <div class="grid-column"></div>
54
+ <div class="grid-column"></div>
55
+ <div class="grid-column"></div>
56
+ </div>
57
+
58
+ <div id="eight-columns" class="row">
59
+ <div class="grid-column"></div>
60
+ <div class="grid-column"></div>
61
+ <div class="grid-column"></div>
62
+ <div class="grid-column"></div>
63
+ <div class="grid-column"></div>
64
+ <div class="grid-column"></div>
65
+ <div class="grid-column"></div>
66
+ <div class="grid-column"></div>
67
+ </div>
68
+
69
+ </section>
70
+
71
+ <section id="text-columns-example">
72
+ <h4>Text Columns</h4>
73
+ <h5> Two Columns</h5>
74
+ <div id="two-text-columns" class="text-columns">
75
+ <p>Pellentesque placerat rhoncus viverra. Nunc a enim at est egestas semper. Pellentesque ultrices dapibus magna, non dapibus ipsum pharetra non. Donec viverra, velit in lobortis commodo, ante erat faucibus nisl, ut lobortis enim dolor euismod libero. Maecenas blandit ullamcorper sem, et rutrum sem sagittis vel. Nulla rhoncus ante fermentum leo dictum cursus. In bibendum vehicula lectus, id imperdiet libero tempus ac. Aenean eget tellus ac tortor facilisis venenatis. Donec ut libero ante, a mattis justo. Duis ullamcorper nulla egestas ante vehicula in posuere nunc congue. Aenean sit amet odio at magna viverra vulputate. In vestibulum, ante quis rhoncus pulvinar, mauris odio lacinia lacus, at auctor enim nisi sed elit. In venenatis tincidunt sollicitudin. Aliquam interdum orci vel turpis condimentum feugiat.</p>
76
+ </div>
77
+
78
+ <h5> Three Columns</h5>
79
+ <div id="three-text-columns" class="text-columns">
80
+ <p>Pellentesque placerat rhoncus viverra. Nunc a enim at est egestas semper. Pellentesque ultrices dapibus magna, non dapibus ipsum pharetra non. Donec viverra, velit in lobortis commodo, ante erat faucibus nisl, ut lobortis enim dolor euismod libero. Maecenas blandit ullamcorper sem, et rutrum sem sagittis vel. Nulla rhoncus ante fermentum leo dictum cursus. In bibendum vehicula lectus, id imperdiet libero tempus ac. Aenean eget tellus ac tortor facilisis venenatis. Donec ut libero ante, a mattis justo. Duis ullamcorper nulla egestas ante vehicula in posuere nunc congue. Aenean sit amet odio at magna viverra vulputate. In vestibulum, ante quis rhoncus pulvinar, mauris odio lacinia lacus, at auctor enim nisi sed elit. In venenatis tincidunt sollicitudin. Aliquam interdum orci vel turpis condimentum feugiat.</p>
81
+ </div>
82
+
83
+ <h5> Four Columns</h5>
84
+ <div id="four-text-columns" class="text-columns">
85
+ <p>Pellentesque placerat rhoncus viverra. Nunc a enim at est egestas semper. Pellentesque ultrices dapibus magna, non dapibus ipsum pharetra non. Donec viverra, velit in lobortis commodo, ante erat faucibus nisl, ut lobortis enim dolor euismod libero. Maecenas blandit ullamcorper sem, et rutrum sem sagittis vel. Nulla rhoncus ante fermentum leo dictum cursus. In bibendum vehicula lectus, id imperdiet libero tempus ac. Aenean eget tellus ac tortor facilisis venenatis. Donec ut libero ante, a mattis justo. Duis ullamcorper nulla egestas ante vehicula in posuere nunc congue. Aenean sit amet odio at magna viverra vulputate. In vestibulum, ante quis rhoncus pulvinar, mauris odio lacinia lacus, at auctor enim nisi sed elit. In venenatis tincidunt sollicitudin. Aliquam interdum orci vel turpis condimentum feugiat.</p>
86
+ </div>
87
+ </section>
88
+
89
+ <section id="forms-example">
90
+ <h4>Forms</h4>
91
+
92
+ <form id="fake-form" action="#">
93
+ <fieldset>
94
+ <legend>Contact Us</legend>
95
+ <div class="field">
96
+ <label for="contact-name">Name:</label>
97
+ <input name="contact-name" type="text" placeholder="name" required autofocus>
98
+ </div>
99
+
100
+ <div class="field">
101
+ <label for="contact-email">Email:</label>
102
+ <input name="contact-email" type="email" placeholder="email" required>
103
+ </div>
104
+
105
+ <div class="field">
106
+ <label for="contact-message">Message:</label>
107
+ <textarea id="contact-message">Type your message here</textarea>
108
+ </div>
109
+
110
+ <div class="field">
111
+ <input name="login" type="submit" value="Login">
112
+ </div>
113
+ </fieldset>
114
+ </form>
115
+ </section>
116
+
117
+
118
+ </div><!-- /content -->
119
+
120
+ <footer>
121
+ </footer>
122
+
123
+ </body>
124
+ </html>
@@ -0,0 +1,51 @@
1
+ #columns-example
2
+ .row
3
+ overflow: hidden
4
+
5
+ .grid-column
6
+ min-height: 15em
7
+ margin: 0.5em 0
8
+ @include showgrid
9
+ background-color: #f1f1f1
10
+
11
+
12
+ #two-columns
13
+ div
14
+ @include column
15
+ @include span(12, -1px)
16
+
17
+ #three-columns
18
+ div
19
+ @include column
20
+ @include span(8, -1px)
21
+
22
+ #four-columns
23
+ div
24
+ @include column
25
+ @include span(6, -1px)
26
+
27
+ #six-columns
28
+ div
29
+ @include column
30
+ @include span(4, -1px)
31
+
32
+ #eight-columns
33
+ div
34
+ @include column
35
+ @include span(3, -1px)
36
+
37
+
38
+ #text-columns-example
39
+
40
+ .text-columns
41
+ @include showgrid
42
+ margin-bottom: 1.5em
43
+
44
+ #two-text-columns
45
+ @include text-columns(2)
46
+
47
+ #three-text-columns
48
+ @include text-columns(3)
49
+
50
+ #four-text-columns
51
+ @include text-columns(4)
@@ -0,0 +1,7 @@
1
+ // Define your own grid
2
+ $grid-columns: 24
3
+ $grid-column-width: 24px
4
+ $grid-gutter-width: 16px
5
+
6
+ // Set your base font size
7
+ $base-font-size: 16px
@@ -0,0 +1,38 @@
1
+ @import settings
2
+ @import ../../../templates/sass/gridpaper/all
3
+
4
+ @import columns
5
+
6
+ body
7
+ @include container
8
+ color: #333
9
+
10
+ p
11
+ line-height: 1.5em
12
+ margin-bottom: 1.5em
13
+ &:last-child
14
+ margin-bottom: 0
15
+
16
+ section, header, footer
17
+ overflow: hidden
18
+ margin-bottom: 1.5em
19
+ padding-bottom: 1.5em
20
+
21
+ .box
22
+ @include column
23
+ @include span(4)
24
+
25
+ .fake-button
26
+ @include border-radius(0px 30px, true)
27
+ @include box-shadow(4px 4px 4px rgba(0,0,0,0.2))
28
+ @include box-gradient(#eee, #aaa)
29
+
30
+ section h4:first-child
31
+ margin-bottom: 0.5em
32
+ padding: 0.25em 0.5em
33
+ color: #fff
34
+ background: #333
35
+
36
+ .something
37
+ display: block
38
+ position: relative
@@ -0,0 +1,3 @@
1
+ body {
2
+ display: block;
3
+ }
@@ -0,0 +1 @@
1
+ @import "nested_folder/_imported_file";
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "gridpaper/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "gridpaper"
7
+ s.version = Gridpaper::VERSION
8
+ s.authors = ["Christian Naths"]
9
+ s.email = ["christiannaths@gmail.com"]
10
+ s.homepage = "http://christiannaths.com"
11
+ s.summary = %q{A SASS Framework}
12
+ s.description = %q{Gridpaper is a CSS framework built on top of SASS.}
13
+
14
+ s.rubyforge_project = "Gridpaperform"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ s.add_dependency("commander", '>= 4.0.4')
22
+ s.add_dependency("sass", '>=3.1.7')
23
+ s.add_dependency("guard", '>=0.8.8')
24
+ s.add_dependency("guard-sass", '>=0.5.4')
25
+ s.add_dependency("colorize", '>= 0.5.8')
26
+ end