├── VERSION ├── .gitignore ├── lib └── compass-tfg.rb ├── stylesheets └── _tfg.scss ├── UNLICENSE ├── compass-tfg-plugin.gemspec ├── Rakefile └── README.md /VERSION: -------------------------------------------------------------------------------- 1 | 0.0.2 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .tmp 3 | pkg 4 | tmp 5 | -------------------------------------------------------------------------------- /lib/compass-tfg.rb: -------------------------------------------------------------------------------- 1 | require 'compass' 2 | Compass::Frameworks.register("tfg", :path => File.dirname(File.dirname(__FILE__))) 3 | -------------------------------------------------------------------------------- /stylesheets/_tfg.scss: -------------------------------------------------------------------------------- 1 | @import "compass/utilities/general/clearfix"; 2 | 3 | $tfg-min-width: 960px !default; 4 | $tfg-max-width: 1080px !default; 5 | $tfg-columns: 12 !default; 6 | $tfg-gutter: 20% !default; 7 | 8 | @mixin tfg-container { 9 | @include pie-clearfix; 10 | 11 | min-width: $tfg-min-width; 12 | max-width: $tfg-max-width; 13 | 14 | margin: auto; 15 | } 16 | 17 | @mixin grid($span) { 18 | width: ((100% - $tfg-gutter) * ($span / $tfg-columns)) + ($tfg-gutter * (($span - 1) / $tfg-columns)); 19 | 20 | margin-left: $tfg-gutter / $tfg-columns / 2; 21 | margin-right: $tfg-gutter / $tfg-columns / 2; 22 | 23 | float: left; 24 | display: block; 25 | } 26 | 27 | @mixin append($span) { 28 | margin-right: ((100% - $tfg-gutter) * ($span / $tfg-columns)) + ($tfg-gutter * (($span + 1) / $tfg-columns / 2)); 29 | } 30 | 31 | @mixin prepend($span) { 32 | margin-left: ((100% - $tfg-gutter) * ($span / $tfg-columns)) + ($tfg-gutter * (($span + 1) / $tfg-columns / 2)); 33 | } 34 | 35 | @mixin alpha { margin-left: 0; } 36 | @mixin omega { margin-right: 0; } 37 | -------------------------------------------------------------------------------- /UNLICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /compass-tfg-plugin.gemspec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby -rubygems 2 | # -*- coding: utf-8 -*- 3 | 4 | 5 | GEMSPEC = Gem::Specification.new do |gem| 6 | gem.version = File.read('VERSION').chomp 7 | gem.date = File.mtime('VERSION').strftime('%Y-%m-%d') 8 | 9 | gem.name = 'compass-tfg-plugin' 10 | gem.summary = 'A Compass-compatible Sass port of the Tiny Fluid Grid system, plus extras.' 11 | gem.homepage = 'http://github.com/zacharyvoase/compass-tfg-plugin' 12 | gem.license = 'Public Domain' if gem.respond_to?(:license=) 13 | gem.description = 'The happy & awesome way to build fluid grid based websites (http://tinyfluidgrid.com/).' 14 | 15 | gem.authors = ['Zachary Voase'] 16 | gem.email = 'z@zacharyvoase.com' 17 | 18 | gem.platform = Gem::Platform::RUBY 19 | gem.files = %w(README.md compass-tfg-plugin.gemspec) + Dir['lib/**/*.rb'] + Dir['stylesheets/**/*.scss'] 20 | gem.bindir = %q(bin) 21 | gem.executables = %w() 22 | gem.require_paths = %w(lib) 23 | gem.extensions = %w() 24 | gem.test_files = %w() 25 | gem.has_rdoc = false 26 | 27 | gem.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") 28 | gem.rubygems_version = "1.3.6" 29 | gem.add_dependency 'compass', '>= 0.10.0.rc3' 30 | gem.post_install_message = nil 31 | end 32 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Zack's Skeleton Rakefile. 2 | # http://github.com/zacharyvoase/rakefile 3 | 4 | $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), 'lib'))) 5 | 6 | require 'rubygems' 7 | require 'shellwords' 8 | 9 | # ---- Helpers ---- 10 | 11 | def scope(path) 12 | File.join(File.dirname(__FILE__), path) 13 | end 14 | 15 | # ---- Packaging ---- 16 | 17 | require 'rake/gempackagetask' 18 | abort "Gemspec file not found" unless gemspec_file = Dir['*.gemspec'].first 19 | load gemspec_file 20 | Rake::GemPackageTask.new(GEMSPEC) do |pkg| 21 | pkg.need_zip = true 22 | pkg.need_tar = true 23 | end 24 | 25 | namespace :bump do 26 | def get_current_version 27 | File.read("VERSION").split(".").map(&:to_i) 28 | end 29 | 30 | def write_current_version(ver) 31 | File.open("VERSION", "w") { |f| f << ver.join(".") } 32 | FileUtils.touch("VERSION") 33 | sh ["git", "commit", "-m", "Bumped to v#{ver.join(".")}.", "VERSION"].shelljoin 34 | sh ["git", "tag", "v#{ver.join(".")}"].shelljoin 35 | end 36 | 37 | desc "Increment the bugfix version" 38 | task :bug do 39 | ver = get_current_version 40 | ver[2] += 1 41 | write_current_version(ver) 42 | end 43 | 44 | desc "Increment the minor version" 45 | task :min do 46 | ver = get_current_version 47 | ver[1] += 1 48 | ver[2] = 0 49 | write_current_version(ver) 50 | end 51 | 52 | desc "Increment the major version" 53 | task :maj do 54 | ver = get_current_version 55 | ver[0] += 1 56 | ver[1] = 0 57 | ver[2] = 0 58 | write_current_version(ver) 59 | end 60 | end 61 | 62 | # ---- TODO ---- 63 | 64 | desc "Retrieve a list of TODO/FIXME/XXX comments in your Ruby code" 65 | task :todo do 66 | pattern = /(TODO|FIXME|XXX)/i 67 | Dir['**/*.rb'].each do |file| 68 | File.open(file).readlines.each_with_index do |line, lineno| 69 | puts "#{file}:#{lineno + 1}:#{line}" if line =~ pattern 70 | end 71 | end 72 | end 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Tiny Fluid Grid: Compass Plugin 2 | 3 | This is a [Compass][] plugin which implements the [tiny fluid grid][], 4 | originally developed by [Girlfriend][]. Get your semantic grid on. 5 | 6 | [compass]: http://compass-style.org/ 7 | [tiny fluid grid]: http://tinyfluidgrid.com/ 8 | [girlfriend]: http://girlfriendnyc.com/ 9 | 10 | 11 | ## Install It. 12 | 13 | [sudo] gem install compass-tfg-plugin 14 | 15 | 16 | ## Use It. 17 | 18 | If you’re creating a typical standalone project, use: 19 | 20 | compass create -r compass-tfg my_project 21 | 22 | Otherwise, make sure you `require 'compass-tfg'` at some point before running 23 | Compass/Sass. 24 | 25 | 26 | ### Haml/HTML 27 | 28 | Make your document structure look something like this: 29 | 30 | #container 31 | / row 1: 32 | #col1 33 | #subcol1 34 | #subcol2 35 | #col2 36 | 37 | / row 2: 38 | #col3 39 | #col4 40 | #col5 41 | 42 | 43 | ### Sass 44 | 45 | @import "tfg"; 46 | 47 | // The following configuration variables are all optional. 48 | $tfg-min-width: 960px; // default 800px 49 | $tfg-max-width: 1200px; // default 960px 50 | $tfg-columns: 16; // default 12 51 | $tfg-gutter: 30%; // default 20% 52 | 53 | #container { 54 | @include tfg-container; 55 | 56 | // Row 1 57 | 58 | #col1 { 59 | @include grid(8); 60 | 61 | #subcol1 { 62 | @include grid(3); 63 | @include alpha; 64 | } 65 | 66 | #subcol2 { 67 | @include grid(5); 68 | @include omega; 69 | } 70 | } 71 | 72 | #col2 { 73 | @include grid(5); 74 | @include prepend(2); 75 | @include append(1); 76 | } 77 | 78 | // Row 2: 79 | 80 | #col3 { @include grid(4); } 81 | #col4 { @include grid(6); } 82 | #col5 { @include grid(6); } 83 | } 84 | 85 | 86 | ## (Un)license 87 | 88 | This is free and unencumbered software released into the public domain. 89 | 90 | Anyone is free to copy, modify, publish, use, compile, sell, or 91 | distribute this software, either in source code form or as a compiled 92 | binary, for any purpose, commercial or non-commercial, and by any 93 | means. 94 | 95 | In jurisdictions that recognize copyright laws, the author or authors 96 | of this software dedicate any and all copyright interest in the 97 | software to the public domain. We make this dedication for the benefit 98 | of the public at large and to the detriment of our heirs and 99 | successors. We intend this dedication to be an overt act of 100 | relinquishment in perpetuity of all present and future rights to this 101 | software under copyright law. 102 | 103 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 104 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 105 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 106 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 107 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 108 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 109 | OTHER DEALINGS IN THE SOFTWARE. 110 | 111 | For more information, please refer to 112 | --------------------------------------------------------------------------------