simple-compass 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/.gitignore +2 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +6 -0
  4. data/Gemfile.lock +26 -0
  5. data/Rakefile +8 -0
  6. data/lib/simple-compass.rb +17 -0
  7. data/lib/simple-compass/sass/functions/display.rb +27 -0
  8. data/lib/simple-compass/sass/functions/lists.rb +101 -0
  9. data/lib/simple-compass/sass/functions/selectors.rb +64 -0
  10. data/lib/simple-compass/sass/functions/sprites.rb +218 -0
  11. data/lib/simple-compass/version.rb +3 -0
  12. data/sass/compass.scss +1 -0
  13. data/sass/compass/_css3.scss +20 -0
  14. data/sass/compass/_layout.scss +3 -0
  15. data/sass/compass/_reset-legacy.scss +3 -0
  16. data/sass/compass/_reset.scss +3 -0
  17. data/sass/compass/_support.scss +40 -0
  18. data/sass/compass/_typography.scss +4 -0
  19. data/sass/compass/_utilities.scss +9 -0
  20. data/sass/compass/css3/_appearance.scss +17 -0
  21. data/sass/compass/css3/_background-clip.scss +43 -0
  22. data/sass/compass/css3/_background-origin.scss +42 -0
  23. data/sass/compass/css3/_background-size.scss +26 -0
  24. data/sass/compass/css3/_border-radius.scss +130 -0
  25. data/sass/compass/css3/_box-shadow.scss +76 -0
  26. data/sass/compass/css3/_box-sizing.scss +13 -0
  27. data/sass/compass/css3/_box.scss +111 -0
  28. data/sass/compass/css3/_columns.scss +157 -0
  29. data/sass/compass/css3/_filter.scss +23 -0
  30. data/sass/compass/css3/_font-face.scss +48 -0
  31. data/sass/compass/css3/_hyphenation.scss +77 -0
  32. data/sass/compass/css3/_images.scss +132 -0
  33. data/sass/compass/css3/_inline-block.scss +22 -0
  34. data/sass/compass/css3/_opacity.scss +19 -0
  35. data/sass/compass/css3/_pie.scss +73 -0
  36. data/sass/compass/css3/_regions.scss +22 -0
  37. data/sass/compass/css3/_shared.scss +38 -0
  38. data/sass/compass/css3/_text-shadow.scss +87 -0
  39. data/sass/compass/css3/_transform-legacy.scss +87 -0
  40. data/sass/compass/css3/_transform.scss +598 -0
  41. data/sass/compass/css3/_transition.scss +221 -0
  42. data/sass/compass/css3/_user-interface.scss +17 -0
  43. data/sass/compass/layout/_grid-background.scss +178 -0
  44. data/sass/compass/layout/_sticky-footer.scss +23 -0
  45. data/sass/compass/layout/_stretching.scss +24 -0
  46. data/sass/compass/reset/_utilities-legacy.scss +135 -0
  47. data/sass/compass/reset/_utilities.scss +142 -0
  48. data/sass/compass/typography/_links.scss +3 -0
  49. data/sass/compass/typography/_lists.scss +4 -0
  50. data/sass/compass/typography/_text.scss +4 -0
  51. data/sass/compass/typography/_vertical_rhythm.scss +221 -0
  52. data/sass/compass/typography/links/_hover-link.scss +5 -0
  53. data/sass/compass/typography/links/_link-colors.scss +28 -0
  54. data/sass/compass/typography/links/_unstyled-link.scss +7 -0
  55. data/sass/compass/typography/lists/_bullets.scss +34 -0
  56. data/sass/compass/typography/lists/_horizontal-list.scss +61 -0
  57. data/sass/compass/typography/lists/_inline-block-list.scss +50 -0
  58. data/sass/compass/typography/lists/_inline-list.scss +44 -0
  59. data/sass/compass/typography/text/_ellipsis.scss +25 -0
  60. data/sass/compass/typography/text/_force-wrap.scss +12 -0
  61. data/sass/compass/typography/text/_nowrap.scss +2 -0
  62. data/sass/compass/typography/text/_replacement.scss +68 -0
  63. data/sass/compass/utilities/_color.scss +1 -0
  64. data/sass/compass/utilities/_general.scss +6 -0
  65. data/sass/compass/utilities/_links.scss +5 -0
  66. data/sass/compass/utilities/_lists.scss +6 -0
  67. data/sass/compass/utilities/_print.scss +17 -0
  68. data/sass/compass/utilities/_sprites.scss +2 -0
  69. data/sass/compass/utilities/_tables.scss +3 -0
  70. data/sass/compass/utilities/_text.scss +5 -0
  71. data/sass/compass/utilities/color/_contrast.scss +28 -0
  72. data/sass/compass/utilities/general/_clearfix.scss +44 -0
  73. data/sass/compass/utilities/general/_float.scss +30 -0
  74. data/sass/compass/utilities/general/_hacks.scss +46 -0
  75. data/sass/compass/utilities/general/_min.scss +16 -0
  76. data/sass/compass/utilities/general/_reset.scss +2 -0
  77. data/sass/compass/utilities/general/_tabs.scss +1 -0
  78. data/sass/compass/utilities/general/_tag-cloud.scss +18 -0
  79. data/sass/compass/utilities/links/_hover-link.scss +3 -0
  80. data/sass/compass/utilities/links/_link-colors.scss +3 -0
  81. data/sass/compass/utilities/links/_unstyled-link.scss +3 -0
  82. data/sass/compass/utilities/lists/_bullets.scss +3 -0
  83. data/sass/compass/utilities/lists/_horizontal-list.scss +3 -0
  84. data/sass/compass/utilities/lists/_inline-block-list.scss +3 -0
  85. data/sass/compass/utilities/lists/_inline-list.scss +3 -0
  86. data/sass/compass/utilities/sprites/_base.scss +66 -0
  87. data/sass/compass/utilities/sprites/_sprite-img.scss +79 -0
  88. data/sass/compass/utilities/tables/_alternating-rows-and-columns.scss +22 -0
  89. data/sass/compass/utilities/tables/_borders.scss +33 -0
  90. data/sass/compass/utilities/tables/_scaffolding.scss +9 -0
  91. data/sass/compass/utilities/text/_ellipsis.scss +3 -0
  92. data/sass/compass/utilities/text/_nowrap.scss +3 -0
  93. data/sass/compass/utilities/text/_replacement.scss +3 -0
  94. data/simple-compass.gemspec +21 -0
  95. data/spec/fixtures/headings_test.sass +2 -0
  96. data/spec/fixtures/opacity_test.sass +7 -0
  97. data/spec/fixtures/reset_test.sass +1 -0
  98. data/spec/headings_spec.rb +9 -0
  99. data/spec/opacity_spec.rb +9 -0
  100. data/spec/reset_spec.rb +9 -0
  101. data/spec/spec_helper.rb +7 -0
  102. metadata +169 -0
@@ -0,0 +1,221 @@
1
+ @import "shared";
2
+
3
+ // CSS Transitions
4
+ // Currently only works in Webkit.
5
+ //
6
+ // * expected in CSS3, FireFox 3.6/7 and Opera Presto 2.3
7
+ // * We'll be prepared.
8
+ //
9
+ // Including this submodule sets following defaults for the mixins:
10
+ //
11
+ // $default-transition-property : all
12
+ // $default-transition-duration : 1s
13
+ // $default-transition-function : false
14
+ // $default-transition-delay : false
15
+ //
16
+ // Override them if you like. Timing-function and delay are set to false for browser defaults (ease, 0s).
17
+
18
+ $default-transition-property: all !default;
19
+
20
+ $default-transition-duration: 1s !default;
21
+
22
+ $default-transition-function: false !default;
23
+
24
+ $default-transition-delay: false !default;
25
+
26
+ $transitionable-prefixed-values: transform, transform-origin !default;
27
+
28
+ // One or more properties to transition
29
+ //
30
+ // * for multiple, use a comma-delimited list
31
+ // * also accepts "all" or "none"
32
+
33
+ @mixin transition-property($property-1: $default-transition-property,
34
+ $property-2 : false,
35
+ $property-3 : false,
36
+ $property-4 : false,
37
+ $property-5 : false,
38
+ $property-6 : false,
39
+ $property-7 : false,
40
+ $property-8 : false,
41
+ $property-9 : false,
42
+ $property-10: false
43
+ ) {
44
+ @if type-of($property-1) == string { $property-1: unquote($property-1); }
45
+ $properties: compact($property-1, $property-2, $property-3, $property-4, $property-5, $property-6, $property-7, $property-8, $property-9, $property-10);
46
+ @if $experimental-support-for-webkit { -webkit-transition-property : prefixed-for-transition(-webkit, $properties); }
47
+ @if $experimental-support-for-mozilla { -moz-transition-property : prefixed-for-transition(-moz, $properties); }
48
+ @if $experimental-support-for-opera { -o-transition-property : prefixed-for-transition(-o, $properties); }
49
+ transition-property : $properties;
50
+ }
51
+
52
+ // One or more durations in seconds
53
+ //
54
+ // * for multiple, use a comma-delimited list
55
+ // * these durations will affect the properties in the same list position
56
+
57
+ @mixin transition-duration($duration-1: $default-transition-duration,
58
+ $duration-2 : false,
59
+ $duration-3 : false,
60
+ $duration-4 : false,
61
+ $duration-5 : false,
62
+ $duration-6 : false,
63
+ $duration-7 : false,
64
+ $duration-8 : false,
65
+ $duration-9 : false,
66
+ $duration-10: false
67
+ ) {
68
+ @if type-of($duration-1) == string { $duration-1: unquote($duration-1); }
69
+ $durations: compact($duration-1, $duration-2, $duration-3, $duration-4, $duration-5, $duration-6, $duration-7, $duration-8, $duration-9, $duration-10);
70
+ @include experimental(transition-duration, $durations,
71
+ -moz, -webkit, -o, not -ms, not -khtml, official
72
+ );
73
+ }
74
+
75
+ // One or more timing functions
76
+ //
77
+ // * [ ease | linear | ease-in | ease-out | ease-in-out | cubic-bezier(x1, y1, x2, y2)]
78
+ // * For multiple, use a comma-delimited list
79
+ // * These functions will effect the properties in the same list position
80
+
81
+ @mixin transition-timing-function($function-1: $default-transition-function,
82
+ $function-2 : false,
83
+ $function-3 : false,
84
+ $function-4 : false,
85
+ $function-5 : false,
86
+ $function-6 : false,
87
+ $function-7 : false,
88
+ $function-8 : false,
89
+ $function-9 : false,
90
+ $function-10: false
91
+ ) {
92
+ $function-1: unquote($function-1);
93
+ $functions: compact($function-1, $function-2, $function-3, $function-4, $function-5, $function-6, $function-7, $function-8, $function-9, $function-10);
94
+ @include experimental(transition-timing-function, $functions,
95
+ -moz, -webkit, -o, not -ms, not -khtml, official
96
+ );
97
+ }
98
+
99
+ // One or more transition-delays in seconds
100
+ //
101
+ // * for multiple, use a comma-delimited list
102
+ // * these delays will effect the properties in the same list position
103
+
104
+ @mixin transition-delay($delay-1: $default-transition-delay,
105
+ $delay-2 : false,
106
+ $delay-3 : false,
107
+ $delay-4 : false,
108
+ $delay-5 : false,
109
+ $delay-6 : false,
110
+ $delay-7 : false,
111
+ $delay-8 : false,
112
+ $delay-9 : false,
113
+ $delay-10: false
114
+ ) {
115
+ @if type-of($delay-1) == string { $delay-1: unquote($delay-1); }
116
+ $delays: compact($delay-1, $delay-2, $delay-3, $delay-4, $delay-5, $delay-6, $delay-7, $delay-8, $delay-9, $delay-10);
117
+ @include experimental(transition-delay, $delays,
118
+ -moz, -webkit, -o, not -ms, not -khtml, official
119
+ );
120
+ }
121
+
122
+ // Transition all-in-one shorthand
123
+
124
+ @mixin single-transition(
125
+ $property: $default-transition-property,
126
+ $duration: $default-transition-duration,
127
+ $function: $default-transition-function,
128
+ $delay: $default-transition-delay
129
+ ) {
130
+ @include transition(compact($property $duration $function $delay));
131
+ }
132
+
133
+ @mixin transition(
134
+ $transition-1 : default,
135
+ $transition-2 : false,
136
+ $transition-3 : false,
137
+ $transition-4 : false,
138
+ $transition-5 : false,
139
+ $transition-6 : false,
140
+ $transition-7 : false,
141
+ $transition-8 : false,
142
+ $transition-9 : false,
143
+ $transition-10: false
144
+ ) {
145
+ @if $transition-1 == default {
146
+ $transition-1 : compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay);
147
+ }
148
+ $transitions: false;
149
+ @if type-of($transition-1) == list and type-of(nth($transition-1,1)) == list {
150
+ $transitions: join($transition-1, compact($transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10), comma);
151
+ } @else {
152
+ $transitions : compact($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10);
153
+ }
154
+ $delays: comma-list();
155
+ $has-delays: false;
156
+ $webkit-value: comma-list();
157
+ $moz-value: comma-list();
158
+ $o-value: comma-list();
159
+
160
+ // This block can be made considerably simpler at the point in time that
161
+ // we no longer need to deal with the differences in how delays are treated.
162
+ @each $transition in $transitions {
163
+ // Extract the values from the list
164
+ // (this would be cleaner if nth took a 3rd argument to provide a default value).
165
+ $property: nth($transition, 1);
166
+ $duration: false;
167
+ $timing-function: false;
168
+ $delay: false;
169
+ @if length($transition) > 1 { $duration: nth($transition, 2); }
170
+ @if length($transition) > 2 { $timing-function: nth($transition, 3); }
171
+ @if length($transition) > 3 { $delay: nth($transition, 4); $has-delays: true; }
172
+
173
+ // If a delay is provided without a timing function
174
+ @if is-time($timing-function) and not $delay { $delay: $timing-function; $timing-function: false; $has-delays: true; }
175
+
176
+ // Keep a list of delays in case one is specified
177
+ $delays: append($delays, if($delay, $delay, 0s));
178
+
179
+ $webkit-value: append($webkit-value, compact(prefixed-for-transition(-webkit, $property) $duration $timing-function));
180
+ $moz-value: append( $moz-value, compact(prefixed-for-transition( -moz, $property) $duration $timing-function $delay));
181
+ $o-value: append( $o-value, compact(prefixed-for-transition( -o, $property) $duration $timing-function $delay));
182
+ }
183
+
184
+ @if $experimental-support-for-webkit { -webkit-transition : $webkit-value;
185
+ // old webkit doesn't support the delay parameter in the shorthand so we progressively enhance it.
186
+ @if $has-delays { -webkit-transition-delay : $delays; } }
187
+ @if $experimental-support-for-mozilla { -moz-transition : $moz-value; }
188
+ @if $experimental-support-for-opera { -o-transition : $o-value; }
189
+ transition : $transitions;
190
+ }
191
+
192
+ // coerce a list to be comma delimited or make a new, empty comma delimited list.
193
+ @function comma-list($list: ()) {
194
+ @return join((), $list, comma);
195
+ }
196
+
197
+ // Returns `$property` with the given prefix if it is found in `$transitionable-prefixed-values`.
198
+ @function prefixed-for-transition($prefix, $property) {
199
+ @if type-of($property) == list {
200
+ $new-list: comma-list();
201
+ @each $v in $property {
202
+ $new-list: append($new-list, prefixed-for-transition($prefix, $v));
203
+ }
204
+ @return $new-list;
205
+ } @else {
206
+ @if index($transitionable-prefixed-values, $property) {
207
+ @return #{$prefix}-#{$property};
208
+ } @else {
209
+ @return $property;
210
+ }
211
+ }
212
+ }
213
+
214
+ // Checks if the value given is a unit of time.
215
+ @function is-time($value) {
216
+ @if type-of($value) == number {
217
+ @return not not index(s ms, unit($value));
218
+ } @else {
219
+ @return false;
220
+ }
221
+ }
@@ -0,0 +1,17 @@
1
+ // User Interface ------------------------------------------------------------
2
+ // This file can be expanded to handle all the user interface properties as
3
+ // they become available in browsers:
4
+ // http://www.w3.org/TR/2000/WD-css3-userint-20000216
5
+ @import "shared";
6
+
7
+
8
+ // This property controls the selection model and granularity of an element.
9
+ //
10
+ // @param $select
11
+ // [ none | text | toggle | element | elements | all | inherit ]
12
+ @mixin user-select($select) {
13
+ $select: unquote($select);
14
+ @include experimental(user-select, $select,
15
+ -moz, -webkit, not -o, not -ms, -khtml, official
16
+ );
17
+ }
@@ -0,0 +1,178 @@
1
+ @import "compass/css3/images";
2
+ @import "compass/css3/background-size";
3
+
4
+ // Set the color of your columns
5
+ $grid-background-column-color : rgba(100, 100, 225, 0.25) !default;
6
+ // Set the color of your gutters
7
+ $grid-background-gutter-color : rgba(0, 0, 0, 0) !default;
8
+
9
+ // Set the total number of columns in your grid
10
+ $grid-background-total-columns : 24 !default;
11
+ // Set the width of your columns
12
+ $grid-background-column-width : 30px !default;
13
+ // Set the width of your gutters
14
+ $grid-background-gutter-width : 10px !default;
15
+ // Set the offset, if your columns are padded in from the container edge
16
+ $grid-background-offset : 0px !default;
17
+
18
+ // Set the color of your baseline
19
+ $grid-background-baseline-color : rgba(0, 0, 0, 0.5) !default;
20
+ // Set the height of your baseline grid
21
+ $grid-background-baseline-height : 1.5em !default;
22
+
23
+ // toggle your columns grids on and off
24
+ $show-column-grid-backgrounds : true !default;
25
+ // toggle your vertical grids on and off
26
+ $show-baseline-grid-backgrounds : true !default;
27
+ // toggle all your grids on and off
28
+ $show-grid-backgrounds : true !default;
29
+
30
+ // optionally force your grid-image to remain fluid
31
+ // no matter what units you used to declared your grid.
32
+ $grid-background-force-fluid : false !default;
33
+
34
+
35
+ // Create the gradient needed for baseline grids
36
+ @function get-baseline-gradient(
37
+ $color : $grid-background-baseline-color
38
+ ) {
39
+ $gradient: linear-gradient(bottom, $color 5%, rgba($color,0) 5%);
40
+ @return $gradient;
41
+ }
42
+
43
+ // Create the color-stops needed for horizontal grids
44
+ @function build-grid-background(
45
+ $total : $grid-background-total-columns,
46
+ $column : $grid-background-column-width,
47
+ $gutter : $grid-background-gutter-width,
48
+ $offset : $grid-background-offset,
49
+ $column-color : $grid-background-column-color,
50
+ $gutter-color : $grid-background-gutter-color
51
+ ) {
52
+ $grid: compact();
53
+ $grid: append($grid, $gutter-color $offset, comma);
54
+ @for $i from 0 to $total {
55
+
56
+ // $a represents the start of this column, initially equal to the offset
57
+ $a: $offset;
58
+ @if $i > 0 { $a: $a + (($column + $gutter) * $i); }
59
+
60
+ // $g represents the start of this gutter, equal to $a plus one column-width
61
+ $g: $a + $column;
62
+
63
+ // $z represents the end of a gutter, equal to $g plus one gutter-width
64
+ $z: $g + $gutter;
65
+
66
+ @if (unit($a) == "%") and ($i == ($total - 1)) {
67
+ $z: 100%;
68
+ }
69
+
70
+ // and we add this column/gutter pair to our grid
71
+ $grid: join($grid, ($column-color $a, $column-color $g, $gutter-color $g, $gutter-color $z));
72
+ }
73
+
74
+ @return $grid;
75
+ }
76
+
77
+ // Return the gradient needed for horizontal grids
78
+ @function get-column-gradient(
79
+ $total : $grid-background-total-columns,
80
+ $column : $grid-background-column-width,
81
+ $gutter : $grid-background-gutter-width,
82
+ $offset : $grid-background-offset,
83
+ $column-color : $grid-background-column-color,
84
+ $gutter-color : $grid-background-gutter-color,
85
+ $force-fluid : $grid-background-force-fluid
86
+ ) {
87
+ $grid: unquote("");
88
+
89
+ // don't force fluid grids when they are already fluid.
90
+ @if unit($column) == "%" { $force-fluid: false; }
91
+
92
+ @if $force-fluid {
93
+ $grid: get-column-fluid-grid($total,$column,$gutter,$offset,$column-color,$gutter-color);
94
+ } @else {
95
+ $grid: build-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color);
96
+ }
97
+
98
+ // return the horizontal grid as a gradient
99
+ $gradient: linear-gradient(left, $grid);
100
+ @return $gradient;
101
+ }
102
+
103
+ // Convert a grid from fixed units into percentages.
104
+ @function get-column-fluid-grid(
105
+ $total : $grid-background-total-columns,
106
+ $column : $grid-background-column-width,
107
+ $gutter : $grid-background-gutter-width,
108
+ $offset : $grid-background-offset,
109
+ $column-color : $grid-background-column-color,
110
+ $gutter-color : $grid-background-gutter-color
111
+ ) {
112
+ $context: ($column * $total) + ($gutter * ($total - 1) + ($offset * 2));
113
+ $offset: $offset / $context * 100%;
114
+ $column: $column / $context * 100%;
115
+ $gutter: $gutter / $context * 100%;
116
+
117
+ // return the horizontal grid as a set of color-stops
118
+ $grid: build-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color);
119
+ @return $grid;
120
+ }
121
+
122
+
123
+ // Add just the baseline grid to an element's background
124
+ @mixin baseline-grid-background(
125
+ $baseline : $grid-background-baseline-height,
126
+ $color : $grid-background-baseline-color
127
+ ) {
128
+ @if $show-grid-backgrounds and $show-baseline-grid-backgrounds {
129
+ @include background-image(get-baseline-gradient($color));
130
+ @include background-size(100% $baseline);
131
+ background-position: left top;
132
+ }
133
+ }
134
+
135
+ // Add just the horizontal grid to an element's background
136
+ @mixin column-grid-background(
137
+ $total : $grid-background-total-columns,
138
+ $column : $grid-background-column-width,
139
+ $gutter : $grid-background-gutter-width,
140
+ $offset : $grid-background-offset,
141
+ $column-color : $grid-background-column-color,
142
+ $gutter-color : $grid-background-gutter-color,
143
+ $force-fluid : $grid-background-force-fluid
144
+ ) {
145
+ @if $show-grid-backgrounds and $show-column-grid-backgrounds {
146
+ @include background-image(
147
+ get-column-gradient($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid)
148
+ );
149
+ background-position: left top;
150
+ }
151
+ }
152
+
153
+ // Add both horizontal and baseline grids to an element's background
154
+ @mixin grid-background(
155
+ $total : $grid-background-total-columns,
156
+ $column : $grid-background-column-width,
157
+ $gutter : $grid-background-gutter-width,
158
+ $baseline : $grid-background-baseline-height,
159
+ $offset : $grid-background-offset,
160
+ $column-color : $grid-background-column-color,
161
+ $gutter-color : $grid-background-gutter-color,
162
+ $baseline-color : $grid-background-baseline-color,
163
+ $force-fluid : $grid-background-force-fluid
164
+ ) {
165
+ @if $show-grid-backgrounds {
166
+ @if $show-baseline-grid-backgrounds and $show-column-grid-backgrounds {
167
+ @include background-image(
168
+ get-baseline-gradient($baseline-color),
169
+ get-column-gradient($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid)
170
+ );
171
+ @include background-size(100% $baseline, auto);
172
+ background-position: left top;
173
+ } @else {
174
+ @include baseline-grid-background($baseline, $baseline-color);
175
+ @include column-grid-background($total,$column,$gutter,$offset,$column-color,$gutter-color, $force-fluid);
176
+ }
177
+ }
178
+ }
@@ -0,0 +1,23 @@
1
+ // Based on a [blog post by Ryan Fait](http://ryanfait.com/resources/footer-stick-to-bottom-of-page/).
2
+ //
3
+ // Must be mixed into the top level of your stylesheet.
4
+ //
5
+ // Footer element must be outside of root wrapper element.
6
+ //
7
+ // Footer must be a fixed height.
8
+
9
+ @mixin sticky-footer($footer-height, $root-selector: unquote("#root"), $root-footer-selector: unquote("#root_footer"), $footer-selector: unquote("#footer")) {
10
+ html, body {
11
+ height: 100%; }
12
+ #{$root-selector} {
13
+ clear: both;
14
+ min-height: 100%;
15
+ height: auto !important;
16
+ height: 100%;
17
+ margin-bottom: -$footer-height;
18
+ #{$root-footer-selector} {
19
+ height: $footer-height; } }
20
+ #{$footer-selector} {
21
+ clear: both;
22
+ position: relative;
23
+ height: $footer-height; } }
@@ -0,0 +1,24 @@
1
+
2
+ // stretch element height to specified top and bottom position
3
+
4
+ @mixin stretch-y($offset-top:0, $offset-bottom:0) {
5
+ @include stretch($offset-top, false, $offset-bottom, false);
6
+ }
7
+
8
+
9
+ // stretch element width to specified left and right position
10
+
11
+ @mixin stretch-x($offset-left:0, $offset-right:0) {
12
+ @include stretch(false, $offset-right, false, $offset-left);
13
+ }
14
+
15
+
16
+ // shorthand to stretch element height and width
17
+
18
+ @mixin stretch($offset-top:0, $offset-right:0, $offset-bottom:0, $offset-left:0) {
19
+ position: absolute;
20
+ @if $offset-top { top: $offset-top; }
21
+ @if $offset-bottom { bottom: $offset-bottom; }
22
+ @if $offset-left { left: $offset-left; }
23
+ @if $offset-right { right: $offset-right; }
24
+ }