Permalink
Browse files

initial import

  • Loading branch information...
0 parents commit 0f2993ad686e22b96252fd2c8cffa4296d640b80 @carljm carljm committed Jul 13, 2009
@@ -0,0 +1,28 @@
+Copyright (c) 2009, Eric Meyer
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of the author nor the names of other
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,10 @@
+lib/susy/compass_plugin.rb
+lib/susy/sass_extensions.rb
+lib/susy.rb
+Manifest
+Rakefile
+README.mkdn
+sass/susy/_grid.sass
+templates/project/grid.sass
+templates/project/manifest.rb
+VERSION
@@ -0,0 +1,62 @@
+Susy - Compass Plugin
+================================
+
+This plugin is a native grid system framework for [Compass](http://compass-style.org/).
+
+Install
+=======
+
+ sudo gem sources --add http://gems.github.com/
+ sudo gem install chriseppstein-compass
+ sudo gem install ericam-compass-susy-plugin
+
+Create a Susy-based Compass Project
+==================================
+
+ compass -r susy -f susy <project name>
+
+Then edit your `screen.sass` and `print.sass` files accordingly. A reset is added automatically.
+
+Customizing your Grid System
+============================
+
+To create a grid system, set the !grid_unit, !total_cols, !col_width, and
+!gutter_width variables and then use the `+grid-container` mixin to declare
+!your container element.
+
+Example:
+
+ !grid_unit = "em"
+ !total_cols = 10
+ !col_width = 7
+ !gutter_width = 1
+
+ #page
+ +grid-container
+
+The default values are 16 columns, column width of 4em and gutter width 1em.
+
+Making Semantic Grids
+=====================
+
+* Use the `+grid-container` mixin to declare your container element.
+
+* Use the `+grid-col` mixin to declare a grid element. The first argument
+is the number of cols, the second is the size (in grid columns) of the
+containing element (defaults to the containers total_cols). The third
+argument should be true if this is the final column (defaults to false), and
+the fourth argument should be true if this element should be floated right
+instead of left.
+
+* Use the `+grid-prefix` and `+grid-suffix` mixins to add grid columns
+before or after a grid element.
+
+Example:
+
+ #page
+ +grid-container
+ #left-nav
+ +grid-col(3)
+ #main-content
+ +grid-prefix(1)
+ +grid-col(4, 10, true)
@@ -0,0 +1,22 @@
+require 'fileutils'
+require 'sass'
+require 'lib/susy/sass_extensions'
+
+begin
+ require 'echoe'
+
+ Echoe.new('compass-susy-plugin', open('VERSION').read) do |p|
+ # p.rubyforge_name = 'susy'
+ p.summary = "A Compass grid system plugin."
+ 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."
+ p.url = "http://github.com/ericam/compass-susy-plugin"
+ p.author = ['Eric Meyer']
+ p.email = "eric@oddbird.net"
+ p.dependencies = ["chriseppstein-compass"]
+ p.has_rdoc = false
+ end
+
+rescue LoadError => boom
+ puts "You are missing a dependency required for meta-operations on this gem."
+ puts "#{boom.to_s.capitalize}."
+end
@@ -0,0 +1 @@
+0.1.0
@@ -0,0 +1,36 @@
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{compass-susy-plugin}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Eric Meyer"]
+ s.date = %q{2009-07-12}
+ 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.}
+ s.email = %q{eric@oddbird.net}
+ s.extra_rdoc_files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "README.mkdn"]
+ s.files = ["lib/susy/compass_plugin.rb", "lib/susy/sass_extensions.rb", "lib/susy.rb", "Manifest", "Rakefile", "README.mkdn", "sass/susy/_grid.sass", "templates/project/grid.sass", "templates/project/manifest.rb", "VERSION", "compass-susy-plugin.gemspec"]
+ s.homepage = %q{http://github.com/ericam/compass-susy-plugin}
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Compass-Susy-plugin", "--main", "README.mkdn"]
+ s.require_paths = ["lib"]
+ s.rubyforge_project = %q{compass-susy-plugin}
+ s.rubygems_version = %q{1.3.3}
+ s.summary = %q{A Compass grid system plugin.}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_runtime_dependency(%q<chriseppstein-compass>, [">= 0"])
+ s.add_development_dependency(%q<echoe>, [">= 0"])
+ else
+ s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
+ s.add_dependency(%q<echoe>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<chriseppstein-compass>, [">= 0"])
+ s.add_dependency(%q<echoe>, [">= 0"])
+ end
+end
@@ -0,0 +1,2 @@
+require File.join(File.dirname(__FILE__), 'susy', 'compass_plugin')
+require File.join(File.dirname(__FILE__), 'susy', 'sass_extensions')
@@ -0,0 +1,5 @@
+options = Hash.new
+options[:stylesheets_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'sass'))
+options[:templates_directory] = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'templates'))
+
+Compass::Frameworks.register('susy', options)
@@ -0,0 +1,7 @@
+require 'sass'
+
+module Sass::Script::Functions
+ def enumerate(prefix, from_index, to_index)
+ Sass::Script::String.new(((from_index.value)..(to_index.value)).map{|i| "#{prefix}#{i}"}.join(", "))
+ end
+end
@@ -0,0 +1,32 @@
+!grid_unit ||= "em"
+!total_cols ||= 16
+!col_width ||= 4
+!gutter_width ||= 1
+
+=grid-container(!grid = !total_cols )
+ :margin-left auto
+ :margin-right auto
+ :overflow hidden
+ :width= (!grid * !col_width) + ((!grid - 1) * !gutter_width) + !grid_unit
+ :max-width 99%
+
+=get_col_width(!n, !context = !total_cols)
+ :width= ((!n * !col_width) + ((!n - 1) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
+
+=grid-col(!n, !last = false, !context = !total_cols, !switch = false)
+ +get_col_width(!n, !context)
+ :display inline
+ @if !switch
+ :float right
+ @else
+ :float left
+ @if !last
+ :margin-right 0
+ @else
+ :margin-right= !gutter_width / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
+
+=grid-prefix(!n, !context = !total_cols)
+ :padding-left= ((!n * !col_width) + ((!n) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
+
+=grid-suffix(!n, !context = !total_cols)
+ :padding-right= ((!n * !col_width) + ((!n-1) * !gutter_width)) / ((!context * !col_width) + ((!context - 1) * !gutter_width)) * 100 + "%"
@@ -0,0 +1,111 @@
+@import compass/utilities.sass
+
+// removes all background images and colors from the element and offspring, and adds a grid image
+=show-grid(!src)
+ :background
+ :image= "url("!src")"
+ :repeat repeat
+ :position top left
+ *
+ :background transparent
+
+// an inline-block list that works in IE
+=inline-block-list(!hpad = 0)
+ +horizontal-list-container
+ li
+ +no-bullet
+ +inline-block
+ :padding
+ :left= !hpad
+ :right= !hpad
+ &.first, &:first-child
+ :padding-left 0px
+ &.last, &:last-child
+ :padding-right 0px
+
+// hide an element from the viewport, but keep it for accessability
+=hide
+ :position absolute
+ :top -9999px
+
+// a skip-to-content accessibility link that will appear on focus
+=skip-link( !t = 0, !r = fales, !b = false, !l = false)
+ +hide
+ :display block
+ &:focus
+ @if !t
+ :top= !t
+ @if !r
+ :right= !r
+ @if !b
+ :bottom= !b
+ @if !l
+ :left= !l
+ :z-index 999
+
+// Because some serif fonts add line-height when switching to italics inline:
+=inline-italic
+ :font-style italic
+ :line-height .5
+
+
+// EXPERIMENTAL
+
+=trans(!o = 100)
+ :filter= "alpha(opacity=" + !o + ")"
+ :-moz-opacity= !o / 100
+ :-khtml-opacity= !o / 100
+ :opacity= !o / 100
+
+=rounded(!trbl = false, !tl = false, !tr = false, !br = false, !bl = false)
+ @if !trbl
+ /* Mozilla (FireFox)
+ -moz-border-radius= !trbl
+ /* Webkit (Safari, Chrome)
+ -webkit-border-radius= !trbl
+ /* CSS3
+ border-radius= !trbl
+ @if !tl
+ /* Mozilla (FireFox)
+ -moz-border-radius-topleft= !tl
+ /* Webkit (Safari, Chrome)
+ -webkit-border-top-left-radius= !tl
+ /* CSS3
+ border-top-left-radius= !tl
+ @if !tr
+ /* Mozilla (FireFox)
+ -moz-border-radius-topright= !tr
+ /* Webkit (Safari, Chrome)
+ -webkit-border-top-right-radius= !tr
+ /* CSS3
+ border-top-right-radius= !tr
+ @if !br
+ /* Mozilla (FireFox)
+ -moz-border-radius-bottomright= !br
+ /* Webkit (Safari, Chrome)
+ -webkit-border-bottom-right-radius= !br
+ /* CSS3
+ border-bottom-right-radius= !br
+ @if !bl
+ /* Mozilla (FireFox)
+ -moz-border-radius-bottomleft= !bl
+ /* Webkit (Safari, Chrome)
+ -webkit-border-bottom-left-radius= !bl
+ /* CSS3
+ border-bottom-left-radius= !bl
+
+=box_model(!bm)
+ /* Mozilla (FireFox)
+ -moz-box-sizing= !bm
+ /* Webkit (Safari, Chrome)
+ -webkit-box-sizing= !bm
+ /* IE (8)
+ -ms-box-sizing= !bm
+ /* CSS3
+ box-sizing= !bm
+
+=box_shadow(!ho, !vo, !b, !c )
+ /* Webkit (Safari, Chrome)
+ -webkit-box-shadow= !ho !vo !b !c
+ /* CSS3
+ box-shadow= !ho !vo !b !c
Oops, something went wrong.

0 comments on commit 0f2993a

Please sign in to comment.