smashing-layout 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,63 @@
1
+ # Smashing Layout
2
+
3
+ A Sass experiment to recreate Smashing Magazine's layout (circa 2009) turned Compass extension.
4
+
5
+ ## Installation
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/)
8
+
9
+ ## Usage
10
+
11
+ There are two mixins that produce all the magic in Smashing Layout.
12
+
13
+ ### +smashing-layout
14
+
15
+ The `+smashing-layout` mixin setups the core layout based on the default variable configuration or your overrides.
16
+
17
+ 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
+
19
+ // Configuration
20
+ $direction: right !default
21
+ $max-width: 1400px !default
22
+ $min-width: 1250px !default
23
+
24
+ This assumes the following markup structure to create the layout.
25
+
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>
40
+
41
+ ### +smashing-width
42
+
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.
44
+
45
+ This assumes the following markup structure to apply the smashing-width.
46
+
47
+ <div id="your-id">
48
+ <div class="max-width">
49
+ <div class="min-width">
50
+ ...
51
+ </div>
52
+ </div>
53
+ </div>
54
+
55
+ ## License
56
+
57
+ Copyright (c) 2009 Adam Stacoviak
58
+
59
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
60
+
61
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,2 @@
1
+ # path from the library file to where you're keeping your compass stuff.
2
+ Compass::Frameworks.register("smashing-layout", :path => "#{File.dirname(__FILE__)}/..")
@@ -0,0 +1,72 @@
1
+ @import "compass/utilities";
2
+
3
+ // Configuration
4
+ $direction: right !default;
5
+ $max-width: 1200px !default;
6
+ $min-width: 940px !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
+ // 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) {
30
+ @include smashing-width;
31
+ @include smashing-padding($direction);
32
+ @include smashing-columns($direction); }
33
+
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
36
+ @mixin smashing-width {
37
+ width: 100%;
38
+ .max-width {
39
+ margin: 0 auto;
40
+ max-width: $max-width; }
41
+ .min-width {
42
+ @include pie-clearfix;
43
+ margin: 0 auto;
44
+ min-width: $min-width;
45
+ width: $width; } }
46
+
47
+ // Used only in +smashing-layout
48
+ @mixin smashing-padding($direction) {
49
+ .padding {
50
+ @include pie-clearfix;
51
+ @if $direction == right {
52
+ padding-right: $sidebar-width; }
53
+ @else {
54
+ padding-left: $sidebar-width; }
55
+ width: auto; } }
56
+
57
+ // Used only in +smashing-layout
58
+ @mixin smashing-columns($direction) {
59
+ .column {
60
+ @if $direction == right {
61
+ float: left; }
62
+ @else {
63
+ float: right; }
64
+ position: relative;
65
+ &.primary {
66
+ width: 100%; }
67
+ &.secondary {
68
+ @if $direction == right {
69
+ margin-right: $negative-sidebar-width; }
70
+ @else {
71
+ margin-left: $negative-sidebar-width; }
72
+ width: $sidebar-width; } } }
@@ -0,0 +1,3 @@
1
+ description "Smashing Layout"
2
+
3
+ discover :all
@@ -0,0 +1,2 @@
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.
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smashing-layout
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Adam Stacoviak
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-31 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: compass
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 63
30
+ segments:
31
+ - 0
32
+ - 10
33
+ - 4
34
+ version: 0.10.4
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: A Sass experiment to recreate Smashing Magazine's layout (circa 2009) turned Compass extension
38
+ email: adam@adamstacoviak.com
39
+ executables: []
40
+
41
+ extensions: []
42
+
43
+ extra_rdoc_files: []
44
+
45
+ files:
46
+ - README.mdown
47
+ - VERSION
48
+ - lib/smashing-layout.rb
49
+ - stylesheets/_smashing-layout.scss
50
+ - templates/project/manifest.rb
51
+ - templates/project/screen.sass
52
+ has_rdoc: true
53
+ homepage: http://adamstacoviak.com/
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options: []
58
+
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ hash: 3
67
+ segments:
68
+ - 0
69
+ version: "0"
70
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ requirements: []
80
+
81
+ rubyforge_project:
82
+ rubygems_version: 1.3.7
83
+ signing_key:
84
+ specification_version: 3
85
+ summary: A Sass recreatation of Smashing Magazine's layout (circa 2009)
86
+ test_files: []
87
+