smashing-layout 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+
3
+ # Source: https://github.com/nex3/haml
4
+ gem "haml", "~> 3.0.25"
5
+
6
+ # Source: https://github.com/chriseppstein/compass
7
+ gem "compass", "~> 0.10.6"
@@ -1,56 +1,49 @@
1
1
  # Smashing Layout
2
2
 
3
- A Sass experiment to recreate Smashing Magazine's layout (circa 2009) turned Compass extension.
3
+ The Sass Way to recreate Smashing Magazine's layout (circa 2009).
4
4
 
5
5
  ## Installation
6
6
 
7
- You will need to install this to your specified Compass extensions directory. See the Compass documentation on extensions for more details: [http://compass-style.org/docs/tutorials/extensions/](http://compass-style.org/docs/tutorials/extensions/)
7
+ `gem install smashing-layout`
8
+
9
+ Add `require 'smashing-layout'` to your Compass config file.
8
10
 
9
11
  ## Usage
10
12
 
11
13
  There are two mixins that produce all the magic in Smashing Layout.
12
14
 
13
- ### +smashing-layout
15
+ ### The `smashing-layout` mixin
14
16
 
15
- The `+smashing-layout` mixin setups the core layout based on the default variable configuration or your overrides.
17
+ The `smashing-layout` mixin sets up the core layout based on the default variable configuration or your overrides.
16
18
 
17
19
  Here is the default configuration of Smashing Layout. If you plan to override this, be sure to do so above the import of smashing-layout.
18
20
 
19
21
  // Configuration
20
- $direction: right !default
21
- $max-width: 1400px !default
22
- $min-width: 1250px !default
22
+ $direction: right
23
+ $max-width: 1200px
24
+ $min-width: 900px
23
25
 
24
26
  This assumes the following markup structure to create the layout.
25
27
 
26
- <div id="your-id">
27
- <div class="max-width">
28
- <div class="min-width">
29
- <div class="padding">
30
- <div class="primary column">
31
- ...
32
- </div>
33
- <div class="secondary column">
34
- ...
35
- </div>
36
- </div>
37
- </div>
38
- </div>
39
- </div>
28
+ #your-id
29
+ .max-width
30
+ .min-width
31
+ .padding
32
+ .primary.column
33
+ ...
34
+ .secondary.column
35
+ ...
40
36
 
41
- ### +smashing-width
37
+ ### The `smashing-width` mixin
42
38
 
43
- The `+smashing-width` mixin setups the just the width with no columns based on the default variable configuration or your overrides. This is needed for headers and footers and other parts of your layout that need to be set to the same width as your main content area that you've applied `+smashing-layout` to.
39
+ The `smashing-width` mixin sets up just the width with no columns based on the default variable configuration or your overrides. This is needed for headers and footers and other parts of your layout that need to be set to the same width as your main content areas where you've used the `smashing-layout` mixin.
44
40
 
45
41
  This assumes the following markup structure to apply the smashing-width.
46
42
 
47
- <div id="your-id">
48
- <div class="max-width">
49
- <div class="min-width">
43
+ #your-id
44
+ .max-width
45
+ .min-width
50
46
  ...
51
- </div>
52
- </div>
53
- </div>
54
47
 
55
48
  ## License
56
49
 
@@ -0,0 +1,30 @@
1
+ require 'rubygems'
2
+ require 'bundler/setup'
3
+
4
+ Bundler.require(:default)
5
+
6
+ require 'lib/smashing-layout'
7
+
8
+ namespace :sass do
9
+
10
+ desc "Converts the Sass to SCSS"
11
+ task :convert do
12
+ puts "*** Converting Sass to SCSS ***"
13
+ system "sass-convert stylesheets/*.sass stylesheets/*.scss"
14
+ end
15
+
16
+ end
17
+
18
+ namespace :gem do
19
+
20
+ desc "Build the gem"
21
+ task :build do
22
+ system "gem build *.gemspec"
23
+ end
24
+
25
+ desc "Build and release the gem"
26
+ task :release => :build do
27
+ system "gem push smashing-layout-#{SmashingLayout::VERSION}.gem"
28
+ end
29
+
30
+ end
@@ -1,2 +1,11 @@
1
+ require 'compass'
2
+
1
3
  # path from the library file to where you're keeping your compass stuff.
2
- Compass::Frameworks.register("smashing-layout", :path => "#{File.dirname(__FILE__)}/..")
4
+ Compass::Frameworks.register("smashing-layout", :path => "#{File.dirname(__FILE__)}/..")
5
+
6
+ module SmashingLayout
7
+
8
+ VERSION = "0.0.2".freeze
9
+ DATE = "2011-3-20".freeze
10
+
11
+ end
@@ -0,0 +1,49 @@
1
+ @import compass/utilities
2
+
3
+ // Configuration
4
+ $direction: right !default
5
+ $max-width: 1200px !default
6
+ $min-width: 900px !default
7
+
8
+ // Smashing Layout logic
9
+ $divine-proportion: $min-width / 1.62
10
+ $width: 95%
11
+ $sidebar-width: floor($min-width - $divine-proportion)
12
+ $negative-sidebar-width: -(ceil($sidebar-width))
13
+
14
+ =smashing-layout($direction)
15
+ +smashing-width
16
+ +smashing-padding($direction)
17
+ +smashing-columns($direction)
18
+
19
+ // Sets a div's width to behave like the width of +smashing-layout
20
+ // Assumes 2 inner wrapping div's .max-width and .min-width
21
+ =smashing-width
22
+ width: 100%
23
+ .max-width
24
+ +pie-clearfix
25
+ margin: 0 auto
26
+ min-width: $min-width
27
+ max-width: $max-width
28
+ width: $width
29
+
30
+ // Used only in +smashing-layout
31
+ =smashing-padding($direction)
32
+ .padding
33
+ +pie-clearfix
34
+ padding-#{$direction}: $sidebar-width
35
+ width: auto
36
+
37
+ // Used only in +smashing-layout
38
+ =smashing-columns($direction)
39
+ .column
40
+ @if $direction == right
41
+ float: left
42
+ @else if $direction == left
43
+ float: right
44
+ position: relative
45
+ &.primary
46
+ width: 100%
47
+ &.secondary
48
+ margin-#{$direction}: $negative-sidebar-width
49
+ width: $sidebar-width
@@ -3,55 +3,35 @@
3
3
  // Configuration
4
4
  $direction: right !default;
5
5
  $max-width: 1200px !default;
6
- $min-width: 940px !default;
6
+ $min-width: 900px !default;
7
7
 
8
8
  // Smashing Layout logic
9
9
  $divine-proportion: $min-width / 1.62;
10
10
  $width: 95%;
11
11
  $sidebar-width: floor($min-width - $divine-proportion);
12
- $negative-sidebar-width: - ceil($sidebar-width);
12
+ $negative-sidebar-width: -(ceil($sidebar-width));
13
13
 
14
- // Creates the Smashing Layout.
15
- // IMPORTANT: This assumes the following markup structure to create the layout
16
- //
17
- // <div id="your-id">
18
- // <div class="max-width">
19
- // <div class="min-width">
20
- // <div class="primary column">
21
- // ...
22
- // </div>
23
- // <div class="secondary column">
24
- // ...
25
- // </div>
26
- // </div>
27
- // </div>
28
- // </div>
29
- @mixin smashing-layout($direction: $direction) {
14
+ @mixin smashing-layout($direction) {
30
15
  @include smashing-width;
31
16
  @include smashing-padding($direction);
32
17
  @include smashing-columns($direction); }
33
18
 
34
- // Used to sett a div's width to behave like the width of +smashing-layout
35
- // Assumes 2 inner wrapping div's: .max-width and .min-width
19
+ // Sets a div's width to behave like the width of +smashing-layout
20
+ // Assumes 2 inner wrapping div's .max-width and .min-width
36
21
  @mixin smashing-width {
37
22
  width: 100%;
38
23
  .max-width {
39
- margin: 0 auto;
40
- max-width: $max-width; }
41
- .min-width {
42
24
  @include pie-clearfix;
43
25
  margin: 0 auto;
44
26
  min-width: $min-width;
27
+ max-width: $max-width;
45
28
  width: $width; } }
46
29
 
47
30
  // Used only in +smashing-layout
48
31
  @mixin smashing-padding($direction) {
49
32
  .padding {
50
33
  @include pie-clearfix;
51
- @if $direction == right {
52
- padding-right: $sidebar-width; }
53
- @else {
54
- padding-left: $sidebar-width; }
34
+ padding-#{$direction}: $sidebar-width;
55
35
  width: auto; } }
56
36
 
57
37
  // Used only in +smashing-layout
@@ -59,14 +39,11 @@ $negative-sidebar-width: - ceil($sidebar-width);
59
39
  .column {
60
40
  @if $direction == right {
61
41
  float: left; }
62
- @else {
42
+ @else if $direction == left {
63
43
  float: right; }
64
44
  position: relative;
65
45
  &.primary {
66
46
  width: 100%; }
67
47
  &.secondary {
68
- @if $direction == right {
69
- margin-right: $negative-sidebar-width; }
70
- @else {
71
- margin-left: $negative-sidebar-width; }
48
+ margin-#{$direction}: $negative-sidebar-width;
72
49
  width: $sidebar-width; } } }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smashing-layout
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Stacoviak
@@ -15,25 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-31 00:00:00 -05:00
18
+ date: 2011-03-20 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: compass
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
24
  requirements:
27
25
  - - ">="
28
26
  - !ruby/object:Gem::Version
29
- hash: 63
27
+ hash: 59
30
28
  segments:
31
29
  - 0
32
30
  - 10
33
- - 4
34
- version: 0.10.4
31
+ - 6
32
+ version: 0.10.6
33
+ requirement: *id001
35
34
  type: :runtime
36
- version_requirements: *id001
35
+ name: compass
36
+ prerelease: false
37
37
  description: A Sass experiment to recreate Smashing Magazine's layout (circa 2009) turned Compass extension
38
38
  email: adam@adamstacoviak.com
39
39
  executables: []
@@ -43,12 +43,12 @@ extensions: []
43
43
  extra_rdoc_files: []
44
44
 
45
45
  files:
46
+ - Gemfile
47
+ - Rakefile
46
48
  - README.mdown
47
- - VERSION
48
49
  - lib/smashing-layout.rb
50
+ - stylesheets/_smashing-layout.sass
49
51
  - stylesheets/_smashing-layout.scss
50
- - templates/project/manifest.rb
51
- - templates/project/screen.sass
52
52
  has_rdoc: true
53
53
  homepage: http://adamstacoviak.com/
54
54
  licenses: []
@@ -72,16 +72,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- hash: 3
75
+ hash: 23
76
76
  segments:
77
- - 0
78
- version: "0"
77
+ - 1
78
+ - 3
79
+ - 6
80
+ version: 1.3.6
79
81
  requirements: []
80
82
 
81
83
  rubyforge_project:
82
84
  rubygems_version: 1.3.7
83
85
  signing_key:
84
86
  specification_version: 3
85
- summary: A Sass recreatation of Smashing Magazine's layout (circa 2009)
87
+ summary: A Sass recreatation of Smashing Magazine.com's layout (circa 2009)
86
88
  test_files: []
87
89
 
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.1
@@ -1,3 +0,0 @@
1
- description "Smashing Layout"
2
-
3
- discover :all
@@ -1,2 +0,0 @@
1
- // This is where you put the contents of the main stylesheet for the user's project.
2
- // It should import your sass stylesheets and demonstrate how to use them.