susy 1.0.alpha.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,79 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Margin Mixins
3
+
4
+ // Apply 'columns' margin before an element to push it along the grid.
5
+ //
6
+ // $columns : The number of columns to span.
7
+ // $context : [optional] The context (columns spanned by parent).
8
+ // : Context is required on any nested elements.
9
+ // : Context MUST NOT be declared on a root element.
10
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
11
+ @mixin pre(
12
+ $columns,
13
+ $context : $total-columns,
14
+ $from : $from-direction
15
+ ) {
16
+ margin-#{$from}: space($columns,$context);
17
+ }
18
+
19
+ // 'push' is a synonymn for 'pre'
20
+ @mixin push(
21
+ $columns,
22
+ $context : $total-columns,
23
+ $from : $from-direction
24
+ ) {
25
+ @include pre($columns,$context,$from)
26
+ }
27
+
28
+ // Apply negative 'columns' margin before an element to pull it along the grid.
29
+ //
30
+ // $columns : The number of columns to span.
31
+ // $context : [optional] The context (columns spanned by parent).
32
+ // : Context is required on any nested elements.
33
+ // : Context MUST NOT be declared on a root element.
34
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
35
+ @mixin pull(
36
+ $columns,
37
+ $context : $total-columns,
38
+ $from : $from-direction
39
+ ) {
40
+ margin-#{$from}: 0 - space($columns, $context);
41
+ }
42
+
43
+ // Apply 'columns' margin after an element to contain it in a grid.
44
+ //
45
+ // $columns : The number of columns to span.
46
+ // $context : [optional] The context (columns spanned by parent).
47
+ // : Context is required on any nested elements.
48
+ // : Context MUST NOT be declared on a root element.
49
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
50
+ @mixin post(
51
+ $columns,
52
+ $context : $total-columns,
53
+ $from : $from-direction
54
+ ) {
55
+ $to : opposite-position($from);
56
+ margin-#{$to}: space($columns,$context);
57
+ }
58
+
59
+ // Apply 'columns' before and/or after an element to contain it on a grid.
60
+ //
61
+ // $pre : The number of columns to add as margin before.
62
+ // $post : The number of columns to add as margin after.
63
+ // $context : [optional] The context (columns spanned by parent).
64
+ // : Context is required on any nested elements.
65
+ // : Context MUST NOT be declared on a root element.
66
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
67
+ @mixin squish(
68
+ $pre : false,
69
+ $post : false,
70
+ $context : $total-columns,
71
+ $from : $from-direction
72
+ ) {
73
+ @if $pre {
74
+ @include pre($pre,$context,$from)
75
+ }
76
+ @if $post {
77
+ @include post($post,$context,$from)
78
+ }
79
+ }
@@ -0,0 +1,93 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Media Mixins
3
+
4
+ // Create a new layout context for (@content) descendants.
5
+ //
6
+ // $layout-cols : a (unitless) number of columns to use for this layout.
7
+ @mixin layout(
8
+ $layout-cols
9
+ ) {
10
+ // store default $total-columns setting for later, then change it.
11
+ $default-layout : $total-columns;
12
+ $total-columns : $layout-cols;
13
+
14
+ // apply children in this new layout context.
15
+ @content;
16
+
17
+ // return to default $total-columns setting.
18
+ $total-columns : $default-layout;
19
+ }
20
+
21
+ // Nest a block of code inside a new media-query and layout context.
22
+ //
23
+ // $media-layout : a list of values [$min $layout $max $ie] including...
24
+ // : - one unitless number (columns in a layout)
25
+ // : - two optional lengths (min and max-width media-query breakpoints).
26
+ // : - one optional boolian or string to trigger fallback support for IE.
27
+ // $font-size : [optional] The base font-size of your layout, if you are using ems.
28
+ // : - defaults to $base-font-size
29
+ @mixin at-breakpoint(
30
+ $media-layout,
31
+ $font-size: $base-font-size
32
+ ) {
33
+ $media-layout : medialayout($media-layout,$font-size);
34
+ $min : nth($media-layout,1);
35
+ $layout : nth($media-layout,2);
36
+ $max : nth($media-layout,3);
37
+ $ie : nth($media-layout,4);
38
+
39
+ // We need to have either a min-width breakpoint or a layout in order to proceed.
40
+ @if $min or $layout or $max {
41
+
42
+ // If we don't have a layout, we create one based on the min-width.
43
+ @if not $layout {
44
+ $layout: get-layout($min);
45
+ }
46
+
47
+ // If we still don't have a layout, we have a problem.
48
+ @if $layout {
49
+ // Set our new layout context.
50
+ @include layout($layout) {
51
+ @if $min and $max {
52
+ // Both $min and $max
53
+ @media (min-width: $min) and (max-width: $max) {
54
+ @content;
55
+ }
56
+ } @else {
57
+ @if (not $min) and (not $max) {
58
+ // Neither $min nor $max:
59
+ // We can create a breakpoint based on the number of columns in the layout.
60
+ $min: fix-ems(container-outer-width());
61
+ }
62
+ @if $min {
63
+ // Min only:
64
+ @media (min-width: $min) {
65
+ @content;
66
+ }
67
+ } @else {
68
+ // Max only:
69
+ @media (max-width: $max) {
70
+ @content;
71
+ }
72
+ }
73
+ }
74
+ // Set an IE fallback
75
+ @if $ie {
76
+ @if (type-of($ie) == 'bool') {
77
+ $ie: 'lt-ie9';
78
+ }
79
+ .#{$ie} & {
80
+ @content;
81
+ }
82
+ }
83
+ }
84
+ } @else {
85
+ @warn "Something went horribly wrong here. Try adjusting your variables.";
86
+ }
87
+
88
+ } @else {
89
+ @warn "You need to provide either a valid layout (number of columns)
90
+ or a valid media-query min-width breakpoint (length).";
91
+ }
92
+
93
+ }
@@ -0,0 +1,51 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Padding Mixins
3
+
4
+ // add empty colums as padding before an element.
5
+ // $columns : The number of columns to prefix.
6
+ // $context : [optional] The context (columns spanned by parent).
7
+ // : Context is required on any nested elements.
8
+ // : Context MUST NOT be declared on a root element.
9
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
10
+ @mixin prefix(
11
+ $columns,
12
+ $context : $total-columns,
13
+ $from : $from-direction
14
+ ) {
15
+ padding-#{$from}: space($columns, $context);
16
+ }
17
+
18
+ // add empty colums as padding after an element.
19
+ // $columns : The number of columns to suffix.
20
+ // $context : [optional] The context (columns spanned by parent).
21
+ // : Context is required on any nested elements.
22
+ // : Context MUST NOT be declared on a root element.
23
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
24
+ @mixin suffix(
25
+ $columns,
26
+ $context : $total-columns,
27
+ $from : $from-direction
28
+ ) {
29
+ $to : opposite-position($from);
30
+ padding-#{$to}: space($columns, $context);
31
+ }
32
+
33
+ // add empty colums as padding before and after an element.
34
+ // $columns : The number of columns to pad.
35
+ // $context : [optional] The context (columns spanned by parent).
36
+ // : Context is required on any nested elements.
37
+ // : Context MUST NOT be declared on a root element.
38
+ // $from : The start direction of your layout (e.g. 'left' for ltr languages)
39
+ @mixin pad(
40
+ $prefix : false,
41
+ $suffix : false,
42
+ $context : $total-columns,
43
+ $from : $from-direction
44
+ ) {
45
+ @if $prefix {
46
+ @include prefix($prefix, $context, $from);
47
+ }
48
+ @if $suffix {
49
+ @include suffix($suffix, $context, $from);
50
+ }
51
+ }
@@ -0,0 +1,36 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Susy Settings
3
+
4
+ // The total number of columns in the grid
5
+ $total-columns : 12 !default;
6
+
7
+ // The width of columns and gutters.
8
+ // These must all be set with the comparable units.
9
+ $column-width : 4em !default;
10
+ $gutter-width : 1em !default;
11
+
12
+ // Add padding to your grid.
13
+ $grid-padding : $gutter-width !default;
14
+
15
+ // ---------------------------------------------------------------------------
16
+ // Advanced Settings
17
+
18
+ // From Direction:
19
+ // Controls for right-to-left or bi-directional sites.
20
+ $from-direction : left !default;
21
+
22
+ // Omega Float Direction:
23
+ // The direction that +omega elements are floated by deafult.
24
+ $omega-float : opposite-position($from-direction) !default;
25
+
26
+ // Container Width:
27
+ // Override the total width of your grid, using any length (50em, 75%, etc.)
28
+ $container-width : false !default;
29
+
30
+ // Container Style:
31
+ // 'magic' - Static (fixed or elastic) when there's enough space,
32
+ // fluid when there isn't. This is the SUSY MAGIC SAUCE(TM).
33
+ // 'static' - Forces the grid container to remain static at all times.
34
+ // 'fluid' - Forces the grid to remain fluid at all times.
35
+ // (this will overrule any static $container-width settings)
36
+ $container-style : mixed !default;
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = "susy"
5
+ s.version = "1.0.alpha.0"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["Eric Meyer"]
9
+ s.date = "2012-05-06"
10
+ s.description = "Responsive web design with grids the quick and reliable way."
11
+ s.email = "eric@oddbird.net"
12
+ s.extra_rdoc_files = ["CHANGELOG.mkdn", "LICENSE.txt", "README.mkdn", "lib/susy.rb"]
13
+ s.files = ["CHANGELOG.mkdn", "LICENSE.txt", "Manifest", "README.mkdn", "REFERENCE.mkdn", "Rakefile", "VERSION", "lib/susy.rb", "sass/_susy.scss", "sass/susy/_background.scss", "sass/susy/_functions.scss", "sass/susy/_grid.scss", "sass/susy/_margin.scss", "sass/susy/_media.scss", "sass/susy/_padding.scss", "sass/susy/_settings.scss", "susy.gemspec", "templates/project/_base.scss", "templates/project/manifest.rb", "templates/project/screen.scss"]
14
+ s.homepage = "http://susy.oddbird.net/"
15
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Susy", "--main", "README.mkdn"]
16
+ s.require_paths = ["lib"]
17
+ s.rubyforge_project = "susy"
18
+ s.rubygems_version = "1.8.15"
19
+ s.summary = "A responsive grid system plugin for Compass."
20
+
21
+ if s.respond_to? :specification_version then
22
+ s.specification_version = 3
23
+
24
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
+ s.add_runtime_dependency(%q<compass>, [">= 0.13.alpha.0"])
26
+ else
27
+ s.add_dependency(%q<compass>, [">= 0.13.alpha.0"])
28
+ end
29
+ else
30
+ s.add_dependency(%q<compass>, [">= 0.13.alpha.0"])
31
+ end
32
+ end
@@ -0,0 +1,14 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "susy";
5
+
6
+ // ---------------------------------------------------------------------------
7
+ // Basic Grid
8
+
9
+ $total-columns : 12;
10
+ $column-width : 4em;
11
+ $gutter-width : 1em;
12
+ $grid-padding : $gutter-width;
13
+
14
+ $show-grid-backgrounds : true;
@@ -0,0 +1,19 @@
1
+ stylesheet 'screen.scss', :media => "screen, projection"
2
+ stylesheet '_base.scss'
3
+
4
+ description "Susy: a flexible static/fluid/elastic grid system native to compass."
5
+
6
+ help %Q{
7
+ Please see the Susy website for all documentation and tutorials:
8
+
9
+ http://www.oddbird.net/susy
10
+ }
11
+
12
+ welcome_message %Q{
13
+ Please see the Susy website for all documentation and tutorials:
14
+
15
+ http://www.oddbird.net/susy
16
+
17
+ To get started, set up your grid in the base partial by following the inline instructions.
18
+ }
19
+
@@ -0,0 +1,12 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Imports
3
+
4
+ @import "base";
5
+
6
+ /* -------------------------------------------------------------------------*/
7
+ /* Layout */
8
+
9
+ .container {
10
+ @include container;
11
+ @include susy-grid-background;
12
+ }
metadata ADDED
@@ -0,0 +1,110 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: susy
3
+ version: !ruby/object:Gem::Version
4
+ hash: -3702664260
5
+ prerelease: 4
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - alpha
10
+ - 0
11
+ version: 1.0.alpha.0
12
+ platform: ruby
13
+ authors:
14
+ - Eric Meyer
15
+ autorequire:
16
+ bindir: bin
17
+ cert_chain: []
18
+
19
+ date: 2012-05-06 00:00:00 Z
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: -3702664252
30
+ segments:
31
+ - 0
32
+ - 13
33
+ - alpha
34
+ - 0
35
+ version: 0.13.alpha.0
36
+ type: :runtime
37
+ version_requirements: *id001
38
+ description: Responsive web design with grids the quick and reliable way.
39
+ email: eric@oddbird.net
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files:
45
+ - CHANGELOG.mkdn
46
+ - LICENSE.txt
47
+ - README.mkdn
48
+ - lib/susy.rb
49
+ files:
50
+ - CHANGELOG.mkdn
51
+ - LICENSE.txt
52
+ - Manifest
53
+ - README.mkdn
54
+ - REFERENCE.mkdn
55
+ - Rakefile
56
+ - VERSION
57
+ - lib/susy.rb
58
+ - sass/_susy.scss
59
+ - sass/susy/_background.scss
60
+ - sass/susy/_functions.scss
61
+ - sass/susy/_grid.scss
62
+ - sass/susy/_margin.scss
63
+ - sass/susy/_media.scss
64
+ - sass/susy/_padding.scss
65
+ - sass/susy/_settings.scss
66
+ - susy.gemspec
67
+ - templates/project/_base.scss
68
+ - templates/project/manifest.rb
69
+ - templates/project/screen.scss
70
+ homepage: http://susy.oddbird.net/
71
+ licenses: []
72
+
73
+ post_install_message:
74
+ rdoc_options:
75
+ - --line-numbers
76
+ - --inline-source
77
+ - --title
78
+ - Susy
79
+ - --main
80
+ - README.mkdn
81
+ require_paths:
82
+ - lib
83
+ required_ruby_version: !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 11
98
+ segments:
99
+ - 1
100
+ - 2
101
+ version: "1.2"
102
+ requirements: []
103
+
104
+ rubyforge_project: susy
105
+ rubygems_version: 1.8.15
106
+ signing_key:
107
+ specification_version: 3
108
+ summary: A responsive grid system plugin for Compass.
109
+ test_files: []
110
+