huxley 0.1.0

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 959cd821eefa274cfe890a47c8bcbe1ea286a288
4
+ data.tar.gz: 426af5f3b6a9d6b604e1ab155c23f6d980988ef6
5
+ SHA512:
6
+ metadata.gz: 634e1c8bc9980561ff3ddd643ae07a8d9742e8860a7ac0e9e35c956a1f03cfc2c5d49be65b95cf75cb879215eb09dae21d21f818b3b147c66c92011759012ea5
7
+ data.tar.gz: 8e3bbb30976288d9e4826b177c4e485a1a9c25ad768cbb48361bc97b75bcac3d226ad7f7f3995b15b623073446df25a8e5b45c88c643bac56c97319feb61c533
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ *.gem
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2014 Monospace, Ltd.
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/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # Huxley
2
+ A simple and semantic grid framework for SASS.
3
+ ### License
4
+ Huxley is Copyright © 2014 Monospace, Ltd. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -0,0 +1,3 @@
1
+ @import "huxley/settings"
2
+ @import "huxley/reset"
3
+ @import "huxley/grid"
@@ -0,0 +1,81 @@
1
+ // Sources
2
+ // 7 Habits of Highly Effective Media Queries by Brad Frost [http://bradfrostweb.com/blog/post/7-habits-of-highly-effective-media-queries/]
3
+ // Responsive Web Design by Ethan Marcotte [http://alistapart.com/article/responsive-web-design]
4
+ // http://www.chromaticsites.com/blog/responsive-grid-building-sass-and-zen-grids-tale-breakpoint-grid-breakdown-mixin
5
+ // http://nicolasgallagher.com/micro-clearfix-hack/
6
+
7
+ // Calculated widths
8
+ $padding-width: $padding * $rhythm
9
+ $gutter-width: $gutter * $rhythm
10
+ $max-width: if($max == 0, 100%, $max * $rhythm)
11
+
12
+ // Mixin for responding to different sizes
13
+ @mixin target($target)
14
+ @each $candidate in $targets
15
+ @if $target == nth($candidate, 1)
16
+ @media screen and (min-width: #{nth($candidate, 2) * $rhythm})
17
+ @content
18
+
19
+ // Mixin for spanning different grid columns
20
+ // Size is the number of columns the item spans
21
+ // Position is the column number the grid items starts on
22
+ @mixin span($size, $position, $clear: none)
23
+ box-sizing: border-box
24
+ width: percentage($size / $column-count)
25
+ float: left
26
+ clear: $clear
27
+ margin-left: percentage(($position - 1) / $column-count)
28
+ margin-right: -100%
29
+ padding:
30
+ left: $gutter-width / 2
31
+ right: $gutter-width / 2
32
+
33
+ @mixin clearfix
34
+ &:before, &:after
35
+ content: " "
36
+ display: table
37
+ &:after
38
+ clear: both
39
+
40
+ @mixin container
41
+ @include clearfix
42
+ position: relative
43
+ margin:
44
+ left: auto
45
+ right: auto
46
+ top: 0
47
+ bottom: 0
48
+ padding: 0 $gutter-width + $padding-width
49
+ width: 100%
50
+ max-width: $max-width
51
+ box-sizing: border-box
52
+
53
+ @function count-spans($span-list)
54
+ $count: 0
55
+ @each $span in $span-list
56
+ $count: $count + $span
57
+ @return $count
58
+
59
+ // Mixin for quickly scaffolding responsive grid layouts
60
+ @mixin scaffold-span($target, $span-list)
61
+ $length: length($span-list)
62
+
63
+ // Inflate list if shorter than column count
64
+ $original-list: $span-list
65
+ @while count-spans($span-list) < $column-count
66
+ $span-list: join($span-list, $original-list)
67
+ $length: length($span-list)
68
+
69
+ // Iterate over the span list and generate nth-child rules
70
+ $column-index: 0
71
+ $new-row: true
72
+ @for $index from 1 through length($span-list)
73
+ $span: nth($span-list, $index)
74
+ @include target($target)
75
+ > *:nth-child(#{$length}n + #{$index})
76
+ $position: ($column-index % $column-count) + 1
77
+ @include span($span, $position, if($new-row, left, none))
78
+ @if $grid-debug
79
+ background: transparentize(if($new-row, blue, red), 0.5)
80
+ $new-row: ((($column-index % $column-count) + $span + 1) >= $column-count)
81
+ $column-index: $column-index + $span
@@ -0,0 +1,11 @@
1
+ *
2
+ box-sizing: border-box
3
+
4
+ html, body
5
+ margin: 0
6
+ padding: 0
7
+ width: 100%
8
+ height: 100%
9
+
10
+ html
11
+ font-size: $scale
@@ -0,0 +1,13 @@
1
+ // Configurable variables
2
+ $rhythm: 0.5rem !default
3
+ $scale: 75% !default
4
+ $column-count: 12 !default
5
+ $targets: xs 0, s 50, m 100, l 150, xl 200 !default
6
+ $grid-debug: false !default
7
+
8
+ // Configurable variables in multiples of the rhythms
9
+ $gutter: 4 !default
10
+ $padding: 0 !default
11
+
12
+ // This should be set to none or a multiple of a rhythm
13
+ $max: 200 !default
data/bin/huxley ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../lib/huxley.rb'
3
+ Huxley::Generator.start
data/huxley.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require 'huxley/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'huxley'
6
+ s.version = Huxley::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.date = '2014-04-23'
9
+ s.summary = 'A simple and semantic grid framework for SASS'
10
+ s.authors = ["Devon Tivona"]
11
+ s.email = 'devon@tivona.me'
12
+ s.files = ["lib/huxley.rb"]
13
+ s.homepage = 'http://huxley.tivona.me'
14
+ s.license = "MIT"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ s.add_dependency('sass', '>= 3.2')
21
+ s.add_dependency('bourbon', '>= 2.1')
22
+ s.add_dependency('thor')
23
+ end
@@ -0,0 +1,5 @@
1
+ module Huxley
2
+ class Engine < Rails::Engine
3
+ # Automatically configure the asset pipeline
4
+ end
5
+ end
@@ -0,0 +1,78 @@
1
+ require "huxley/version"
2
+ require "fileutils"
3
+ require "thor"
4
+
5
+ module Huxley
6
+ class Generator < Thor
7
+ map ['-v', '--version'] => :version
8
+
9
+ desc 'install', 'Install Huxley into your project'
10
+ method_options path: :string, force: :boolean
11
+ def install
12
+ if huxley_files_already_exist? and !options[:force]
13
+ puts "Huxley files already installed. No action taken."
14
+ else
15
+ install_files
16
+ puts "Huxley files installed to #{install_path}/"
17
+ end
18
+ end
19
+
20
+ desc 'update', 'Update Huxley'
21
+ method_options path: :string
22
+ def update
23
+ if huxley_files_already_exist?
24
+ remove_huxley_directory
25
+ install_files
26
+ puts "Huxley files updated."
27
+ else
28
+ puts "No existing Huxley installation. No action taken."
29
+ end
30
+ end
31
+
32
+ desc 'remove', 'Remove Huxley from your project'
33
+ method_options path: :string
34
+ def remove
35
+ if huxley_files_already_exist?
36
+ remove_huxley_directory
37
+ puts "Huxley was successfully removed."
38
+ else
39
+ puts "No existing huxley installation. No action taken."
40
+ end
41
+ end
42
+
43
+ private
44
+
45
+ def install_path
46
+ @install_path ||= if options[:path]
47
+ Pathname.new(File.join(options[:path], 'huxley'))
48
+ else
49
+ Pathname.new('huxley')
50
+ end
51
+ end
52
+
53
+ def huxley_files_already_exist?
54
+ install_path.exist?
55
+ end
56
+
57
+ def remove_huxley_directory
58
+ FileUtils.rm_rf(install_path)
59
+ end
60
+
61
+ def install_files
62
+ FileUtils.mkdir_p(install_path)
63
+ FileUtils.cp_r(all_stylesheets, install_path)
64
+ end
65
+
66
+ def all_stylesheets
67
+ Dir["#{stylesheets_directory}/*"]
68
+ end
69
+
70
+ def stylesheets_directory
71
+ File.join(top_level_directory, "app", "assets", "stylesheets")
72
+ end
73
+
74
+ def top_level_directory
75
+ File.dirname(File.dirname(File.dirname(__FILE__)))
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,3 @@
1
+ module Huxley
2
+ VERSION = '0.1.0'
3
+ end
data/lib/huxley.rb ADDED
@@ -0,0 +1,19 @@
1
+ dir = File.dirname(__FILE__)
2
+ $LOAD_PATH.unshift dir unless $LOAD_PATH.include?(dir)
3
+
4
+ require "bourbon"
5
+ require "huxley/generator"
6
+
7
+ unless defined?(Sass)
8
+ require "sass"
9
+ end
10
+
11
+ module Huxley
12
+ if defined?(Rails) and defined?(Rails::Engine)
13
+ class Engine < ::Rails::Engine
14
+ require "huxley/engine"
15
+ end
16
+ else
17
+ Sass.load_paths << File.expand_path("../../app/assets/stylesheets", __FILE__)
18
+ end
19
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: huxley
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Devon Tivona
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-04-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sass
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '3.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '3.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bourbon
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '2.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '2.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description:
56
+ email: devon@tivona.me
57
+ executables:
58
+ - huxley
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - LICENSE
64
+ - README.md
65
+ - app/assets/stylesheets/_huxley.sass
66
+ - app/assets/stylesheets/huxley/_grid.sass
67
+ - app/assets/stylesheets/huxley/_reset.sass
68
+ - app/assets/stylesheets/huxley/_settings.sass
69
+ - bin/huxley
70
+ - huxley.gemspec
71
+ - lib/huxley.rb
72
+ - lib/huxley/engine.rb
73
+ - lib/huxley/generator.rb
74
+ - lib/huxley/version.rb
75
+ homepage: http://huxley.tivona.me
76
+ licenses:
77
+ - MIT
78
+ metadata: {}
79
+ post_install_message:
80
+ rdoc_options: []
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ requirements: []
94
+ rubyforge_project:
95
+ rubygems_version: 2.0.3
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: A simple and semantic grid framework for SASS
99
+ test_files: []