carljm-compass-susy-plugin 0.1.2

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/LICENSE.txt ADDED
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2009, Eric Meyer
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are
6
+ met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+ * Redistributions in binary form must reproduce the above
11
+ copyright notice, this list of conditions and the following
12
+ disclaimer in the documentation and/or other materials provided
13
+ with the distribution.
14
+ * Neither the name of the author nor the names of other
15
+ contributors may be used to endorse or promote products derived
16
+ from this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/Manifest ADDED
@@ -0,0 +1,10 @@
1
+ lib/susy/compass_plugin.rb
2
+ lib/susy/sass_extensions.rb
3
+ lib/susy.rb
4
+ Manifest
5
+ Rakefile
6
+ README.mkdn
7
+ sass/susy/_grid.sass
8
+ templates/project/grid.sass
9
+ templates/project/manifest.rb
10
+ VERSION
data/README.mkdn ADDED
@@ -0,0 +1,62 @@
1
+ Susy - Compass Plugin
2
+ ================================
3
+
4
+ This plugin is a native grid system framework for [Compass](http://compass-style.org/).
5
+
6
+ Install
7
+ =======
8
+
9
+ sudo gem sources --add http://gems.github.com/
10
+ sudo gem install chriseppstein-compass
11
+ sudo gem install ericam-compass-susy-plugin
12
+
13
+ Create a Susy-based Compass Project
14
+ ==================================
15
+
16
+ compass -r susy -f susy <project name>
17
+
18
+ Then edit your `screen.sass` and `print.sass` files accordingly. A reset is added automatically.
19
+
20
+ Customizing your Grid System
21
+ ============================
22
+
23
+ To create a grid system, set the !grid_unit, !total_cols, !col_width, and
24
+ !gutter_width variables and then use the `+grid-container` mixin to declare
25
+ !your container element.
26
+
27
+ Example:
28
+
29
+ !grid_unit = "em"
30
+ !total_cols = 10
31
+ !col_width = 7
32
+ !gutter_width = 1
33
+
34
+ #page
35
+ +grid-container
36
+
37
+ The default values are 16 columns, column width of 4em and gutter width 1em.
38
+
39
+ Making Semantic Grids
40
+ =====================
41
+
42
+ * Use the `+grid-container` mixin to declare your container element.
43
+
44
+ * Use the `+grid-col` mixin to declare a grid element. The first argument
45
+ is the number of cols, the second is the size (in grid columns) of the
46
+ containing element (defaults to the containers total_cols). The third
47
+ argument should be true if this is the final column (defaults to false), and
48
+ the fourth argument should be true if this element should be floated right
49
+ instead of left.
50
+
51
+ * Use the `+grid-prefix` and `+grid-suffix` mixins to add grid columns
52
+ before or after a grid element.
53
+
54
+ Example:
55
+
56
+ #page
57
+ +grid-container
58
+ #left-nav
59
+ +grid-col(3)
60
+ #main-content
61
+ +grid-prefix(1)
62
+ +grid-col(4, 10, true)
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require 'fileutils'
2
+ require 'sass'
3
+ require 'lib/susy/sass_extensions'
4
+
5
+ begin
6
+ require 'echoe'
7
+
8
+ Echoe.new('compass-susy-plugin', open('VERSION').read) do |p|
9
+ # p.rubyforge_name = 'susy'
10
+ p.summary = "A Compass grid system plugin."
11
+ p.description = "Susy is a ground-up native Compass plugin grid system that takes full advantage of Sass' capabilities to remove the tedium from grid-based web design."
12
+ p.url = "http://github.com/ericam/compass-susy-plugin"
13
+ p.author = ['Eric Meyer']
14
+ p.email = "eric@oddbird.net"
15
+ p.dependencies = ["chriseppstein-compass"]
16
+ p.has_rdoc = false
17
+ end
18
+
19
+ rescue LoadError => boom
20
+ puts "You are missing a dependency required for meta-operations on this gem."
21
+ puts "#{boom.to_s.capitalize}."
22
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.2
@@ -0,0 +1,36 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{compass-susy-plugin}
5
+ s.version = "0.1.2"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Eric Meyer"]
9
+ s.date = %q{2009-07-12}
10
+ s.description = %q{Susy is a ground-up native Compass plugin grid system that takes full advantage of Sass' capabilities to remove the tedium from grid-based web design.}
11
+ s.email = %q{eric@oddbird.net}
12
+ s.extra_rdoc_files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "README.mkdn"]
13
+ s.files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "Manifest", "Rakefile", "README.mkdn", "sass/susy/_grid.sass", "sass/susy/_utils.sass", "templates/project/_base.sass", "templates/project/screen.sass", "templates/project/print.sass", "templates/project/ie.sass", "templates/project/manifest.rb", "VERSION", "LICENSE.txt", "compass-susy-plugin.gemspec"]
14
+ s.homepage = %q{http://github.com/ericam/compass-susy-plugin}
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Compass-Susy-plugin", "--main", "README.mkdn"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = %q{compass-susy-plugin}
18
+ s.rubygems_version = %q{1.3.3}
19
+ s.summary = %q{A Compass grid system plugin.}
20
+
21
+ if s.respond_to? :specification_version then
22
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
+ s.specification_version = 3
24
+
25
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
+ s.add_runtime_dependency(%q<chriseppstein-compass>, [">= 0"])
27
+ s.add_development_dependency(%q<echoe>, [">= 0"])
28
+ else
29
+ s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
30
+ s.add_dependency(%q<echoe>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
34
+ s.add_dependency(%q<echoe>, [">= 0"])
35
+ end
36
+ end
data/lib/susy.rb ADDED
@@ -0,0 +1,2 @@
1
+ require File.join(File.dirname(__FILE__), 'susy', 'compass_plugin')
2
+ require File.join(File.dirname(__FILE__), 'susy', 'sass_extensions')
@@ -0,0 +1,5 @@
1
+ options = Hash.new
2
+ options[:stylesheets_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sass'))
3
+ options[:templates_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates'))
4
+
5
+ Compass::Frameworks.register('susy', options)
@@ -0,0 +1,7 @@
1
+ require 'sass'
2
+
3
+ module Sass::Script::Functions
4
+ def enumerate(prefix, from_index, to_index)
5
+ Sass::Script::String.new(((from_index.value)..(to_index.value)).map{|i| "#{prefix}#{i}"}.join(", "))
6
+ end
7
+ end
@@ -0,0 +1,32 @@
1
+ !grid_unit ||= "em"
2
+ !total_cols ||= 16
3
+ !col_width ||= 4
4
+ !gutter_width ||= 1
5
+
6
+ =grid-container(!grid = !total_cols )
7
+ :margin-left auto
8
+ :margin-right auto
9
+ :overflow hidden
10
+ :width= (!grid * !col_width) + ((!grid - 1) * !gutter_width) + !grid_unit
11
+ :max-width 99%
12
+
13
+ =get_col_width(!n, !context = !total_cols)
14
+ :width= ((!n * !col_width) + ((!n - 1) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
15
+
16
+ =grid-col(!n, !last = false, !context = !total_cols, !switch = false)
17
+ +get_col_width(!n, !context)
18
+ :display inline
19
+ @if !switch
20
+ :float right
21
+ @else
22
+ :float left
23
+ @if !last
24
+ :margin-right 0
25
+ @else
26
+ :margin-right= !gutter_width / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
27
+
28
+ =grid-prefix(!n, !context = !total_cols)
29
+ :padding-left= ((!n * !col_width) + ((!n) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
30
+
31
+ =grid-suffix(!n, !context = !total_cols)
32
+ :padding-right= ((!n * !col_width) + ((!n-1) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
@@ -0,0 +1,111 @@
1
+ @import compass/utilities.sass
2
+
3
+ // removes all background images and colors from the element and offspring, and adds a grid image
4
+ =show-grid(!src)
5
+ :background
6
+ :image= "url("!src")"
7
+ :repeat repeat
8
+ :position top left
9
+ *
10
+ :background transparent
11
+
12
+ // an inline-block list that works in IE
13
+ =inline-block-list(!hpad = 0)
14
+ +horizontal-list-container
15
+ li
16
+ +no-bullet
17
+ +inline-block
18
+ :padding
19
+ :left= !hpad
20
+ :right= !hpad
21
+ &.first, &:first-child
22
+ :padding-left 0px
23
+ &.last, &:last-child
24
+ :padding-right 0px
25
+
26
+ // hide an element from the viewport, but keep it for accessability
27
+ =hide
28
+ :position absolute
29
+ :top -9999px
30
+
31
+ // a skip-to-content accessibility link that will appear on focus
32
+ =skip-link( !t = 0, !r = fales, !b = false, !l = false)
33
+ +hide
34
+ :display block
35
+ &:focus
36
+ @if !t
37
+ :top= !t
38
+ @if !r
39
+ :right= !r
40
+ @if !b
41
+ :bottom= !b
42
+ @if !l
43
+ :left= !l
44
+ :z-index 999
45
+
46
+ // Because some serif fonts add line-height when switching to italics inline:
47
+ =inline-italic
48
+ :font-style italic
49
+ :line-height .5
50
+
51
+
52
+ // EXPERIMENTAL
53
+
54
+ =trans(!o = 100)
55
+ :filter= "alpha(opacity=" + !o + ")"
56
+ :-moz-opacity= !o / 100
57
+ :-khtml-opacity= !o / 100
58
+ :opacity= !o / 100
59
+
60
+ =rounded(!trbl = false, !tl = false, !tr = false, !br = false, !bl = false)
61
+ @if !trbl
62
+ /* Mozilla (FireFox)
63
+ -moz-border-radius= !trbl
64
+ /* Webkit (Safari, Chrome)
65
+ -webkit-border-radius= !trbl
66
+ /* CSS3
67
+ border-radius= !trbl
68
+ @if !tl
69
+ /* Mozilla (FireFox)
70
+ -moz-border-radius-topleft= !tl
71
+ /* Webkit (Safari, Chrome)
72
+ -webkit-border-top-left-radius= !tl
73
+ /* CSS3
74
+ border-top-left-radius= !tl
75
+ @if !tr
76
+ /* Mozilla (FireFox)
77
+ -moz-border-radius-topright= !tr
78
+ /* Webkit (Safari, Chrome)
79
+ -webkit-border-top-right-radius= !tr
80
+ /* CSS3
81
+ border-top-right-radius= !tr
82
+ @if !br
83
+ /* Mozilla (FireFox)
84
+ -moz-border-radius-bottomright= !br
85
+ /* Webkit (Safari, Chrome)
86
+ -webkit-border-bottom-right-radius= !br
87
+ /* CSS3
88
+ border-bottom-right-radius= !br
89
+ @if !bl
90
+ /* Mozilla (FireFox)
91
+ -moz-border-radius-bottomleft= !bl
92
+ /* Webkit (Safari, Chrome)
93
+ -webkit-border-bottom-left-radius= !bl
94
+ /* CSS3
95
+ border-bottom-left-radius= !bl
96
+
97
+ =box_model(!bm)
98
+ /* Mozilla (FireFox)
99
+ -moz-box-sizing= !bm
100
+ /* Webkit (Safari, Chrome)
101
+ -webkit-box-sizing= !bm
102
+ /* IE (8)
103
+ -ms-box-sizing= !bm
104
+ /* CSS3
105
+ box-sizing= !bm
106
+
107
+ =box_shadow(!ho, !vo, !b, !c )
108
+ /* Webkit (Safari, Chrome)
109
+ -webkit-box-shadow= !ho !vo !b !c
110
+ /* CSS3
111
+ box-shadow= !ho !vo !b !c
@@ -0,0 +1,102 @@
1
+ //
2
+ // Susy: My own damn Compass/SASS framework
3
+ // by Eric Meyer
4
+ //
5
+
6
+
7
+ /* RESET STYLES
8
+ @import compass/reset.sass
9
+
10
+ // MIXINS
11
+ @import frame/utils.sass
12
+ @import frame/grid.sass
13
+
14
+ // GRID
15
+ // !grid_unit = "em"
16
+ // !total_cols = 10
17
+ // !col_width = 7
18
+ // !gutter_width = 1
19
+
20
+
21
+ // COLORS
22
+ !dark = #000
23
+ !light = #fff
24
+
25
+
26
+ // FONT PRESETS
27
+
28
+ // You set the font and line heights in pixels
29
+ !base_font_size_px ||= 12
30
+ !base_line_height_px ||= 18
31
+
32
+ // SUSY will do the math to make that relative
33
+ !base_line_height = (!base_line_height_px / !base_font_size_px) + "em"
34
+ !base_font_size = (!base_font_size_px / 16) + "em"
35
+
36
+ // Give yourself some font stacks to work with
37
+ =sans-family
38
+ :font-family 'Futura Medium', 'Century Gothic', AppleGothic, sans-serif
39
+
40
+ =serif-family
41
+ :font-family 'Adobe Caslon Pro', 'Big Caslon', Garamond, 'Hoefler Text', 'Times New Roman', Times, serif
42
+
43
+
44
+ // Remember to add default styles to everything!
45
+ /* DEFAULTS
46
+ \:focus
47
+
48
+ /* links
49
+ a
50
+
51
+ /* headers
52
+ h1, h2, h3, h4, h5, h6
53
+
54
+ /* forms
55
+ form
56
+
57
+ fieldset
58
+
59
+ label
60
+
61
+ textarea
62
+
63
+ input
64
+
65
+ input[type=submit]
66
+
67
+ /* block tags
68
+ p
69
+
70
+ =list_default(!ol = false)
71
+ @if !ol
72
+ :list-style decimal-leading-zero
73
+ :margin 0 1.5em 1.5em 2em
74
+ @else
75
+ :list-style disc
76
+ :margin 0 1.5em 1.5em 1.5em
77
+
78
+ ol
79
+ +list_default("ol")
80
+
81
+ ul
82
+ +list_default
83
+
84
+ blockquote
85
+
86
+ /* inline tags
87
+ cite
88
+
89
+ em
90
+ +inline-italic
91
+
92
+ strong
93
+ :font-weight bold
94
+
95
+ ins
96
+ :text-decoration underline
97
+
98
+ del
99
+ :text-decoration line-through
100
+
101
+ /* replaced tags
102
+ img
@@ -0,0 +1,15 @@
1
+ /*
2
+ Welcome to Susy. Use this file to write IE specific override styles.
3
+ Import this file using the following HTML or equivalent:
4
+ <!--[if IE]>
5
+ <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
6
+ <![endif]-->
7
+
8
+ /*
9
+ Theme Name: DEFAULT
10
+ Theme URI: http://eric.dirtcircle.com/
11
+ Description: A default style using the SUSY plugin for Compass/SASS
12
+ Version: 1
13
+ Author: Eric Meyer
14
+
15
+ @import base.sass
@@ -0,0 +1,2 @@
1
+ stylesheet 'screen.sass', :media => "screen, projection"
2
+ stylesheet 'print.sass', :media => "print"
@@ -0,0 +1,14 @@
1
+ /*
2
+ Welcome to Susy. Use this file to define print styles.
3
+ Import this file using the following HTML or equivalent:
4
+ <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />
5
+
6
+ /*
7
+ Theme Name: DEFAULT
8
+ Theme URI: http://eric.dirtcircle.com/
9
+ Description: A default style using the SUSY plugin for Compass/SASS
10
+ Version: 1
11
+ Author: Eric Meyer
12
+
13
+
14
+ @import base.sass
@@ -0,0 +1,29 @@
1
+ /*
2
+ Welcome to Susy. Use this file to define screen styles.
3
+ Import this file using the following HTML or equivalent:
4
+ <link href="/stylesheets/screen.css" media="screen" rel="stylesheet" type="text/css" />
5
+
6
+ /*
7
+ Theme Name: DEFAULT
8
+ Theme URI: http://eric.dirtcircle.com/
9
+ Description: A default style using the SUSY plugin for Compass/SASS
10
+ Version: 1
11
+ Author: Eric Meyer
12
+
13
+ @import base.sass
14
+
15
+ /* STRUCTURE
16
+
17
+
18
+ /* COMPONENTS BY TYPE
19
+
20
+
21
+ /* COMPONENTS BY CONTENT
22
+
23
+
24
+ /* COMPONENTS BY PAGE
25
+
26
+
27
+ /* DEBUG
28
+ / #page
29
+ / +show-grid("../images/grid.gif")
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: carljm-compass-susy-plugin
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Eric Meyer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-12 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: chriseppstein-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
+ - !ruby/object:Gem::Dependency
26
+ name: echoe
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description: Susy is a ground-up native Compass plugin grid system that takes full advantage of Sass' capabilities to remove the tedium from grid-based web design.
36
+ email: eric@oddbird.net
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - lib/susy/compass_plugin.rb
43
+ - lib/susy/sass_extensions.rb
44
+ - lib/susy.rb
45
+ - README.mkdn
46
+ files:
47
+ - lib/susy/compass_plugin.rb
48
+ - lib/susy/sass_extensions.rb
49
+ - lib/susy.rb
50
+ - Manifest
51
+ - Rakefile
52
+ - README.mkdn
53
+ - sass/susy/_grid.sass
54
+ - sass/susy/_utils.sass
55
+ - templates/project/_base.sass
56
+ - templates/project/screen.sass
57
+ - templates/project/print.sass
58
+ - templates/project/ie.sass
59
+ - templates/project/manifest.rb
60
+ - VERSION
61
+ - LICENSE.txt
62
+ - compass-susy-plugin.gemspec
63
+ has_rdoc: false
64
+ homepage: http://github.com/ericam/compass-susy-plugin
65
+ post_install_message:
66
+ rdoc_options:
67
+ - --line-numbers
68
+ - --inline-source
69
+ - --title
70
+ - Compass-Susy-plugin
71
+ - --main
72
+ - README.mkdn
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ required_rubygems_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: "1.2"
86
+ version:
87
+ requirements: []
88
+
89
+ rubyforge_project: compass-susy-plugin
90
+ rubygems_version: 1.2.0
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: A Compass grid system plugin.
94
+ test_files: []
95
+