persistentgrid 0.0.1.beta.1

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.
Files changed (129) hide show
  1. data/README.md +5 -0
  2. data/lib/persistentgrid.rb +4 -0
  3. data/scss/pg/_helpers.scss +7 -0
  4. data/scss/pg/base/_all.scss +9 -0
  5. data/scss/pg/base/_behavior.scss +10 -0
  6. data/scss/pg/base/_helpers.scss +9 -0
  7. data/scss/pg/base/_settings.scss +10 -0
  8. data/scss/pg/base/baserules/_all.scss +8 -0
  9. data/scss/pg/base/baserules/_behavior.scss +125 -0
  10. data/scss/pg/base/baserules/_settings.scss +39 -0
  11. data/scss/pg/base/reset/_all.scss +9 -0
  12. data/scss/pg/base/reset/_behavior.scss +108 -0
  13. data/scss/pg/base/reset/_helpers.scss +7 -0
  14. data/scss/pg/base/reset/_settings.scss +27 -0
  15. data/scss/pg/base/reset/helpers/_all.scss +7 -0
  16. data/scss/pg/base/reset/helpers/_mixins.scss +395 -0
  17. data/scss/pg/base/typography/_all.scss +9 -0
  18. data/scss/pg/base/typography/_behavior.scss +31 -0
  19. data/scss/pg/base/typography/_helpers.scss +7 -0
  20. data/scss/pg/base/typography/_settings.scss +52 -0
  21. data/scss/pg/base/typography/helpers/_all.scss +8 -0
  22. data/scss/pg/base/typography/helpers/_functions.scss +160 -0
  23. data/scss/pg/base/typography/helpers/_mixins.scss +121 -0
  24. data/scss/pg/grid/_all.scss +9 -0
  25. data/scss/pg/grid/_behavior.scss +51 -0
  26. data/scss/pg/grid/_helpers.scss +8 -0
  27. data/scss/pg/grid/_settings.scss +48 -0
  28. data/scss/pg/grid/helpers/_functions.scss +140 -0
  29. data/scss/pg/grid/helpers/_mixins.scss +247 -0
  30. data/scss/pg/helpers/_all.scss +11 -0
  31. data/scss/pg/helpers/_colors.scss +163 -0
  32. data/scss/pg/helpers/_fonts.scss +21 -0
  33. data/scss/pg/helpers/_functions.scss +91 -0
  34. data/scss/pg/helpers/_mixins.scss +7 -0
  35. data/scss/pg/helpers/_settings.scss +11 -0
  36. data/scss/pg/helpers/fonts/_bree-serif.scss +27 -0
  37. data/scss/pg/helpers/fonts/_example.scss +47 -0
  38. data/scss/pg/helpers/fonts/_lato.scss +36 -0
  39. data/scss/pg/helpers/fonts/_monospace.scss +43 -0
  40. data/scss/pg/helpers/fonts/_raleway.scss +35 -0
  41. data/scss/pg/helpers/fonts/_righteous.scss +27 -0
  42. data/scss/pg/helpers/fonts/_roboto.scss +38 -0
  43. data/scss/pg/helpers/fonts/_sans-serif.scss +43 -0
  44. data/scss/pg/helpers/fonts/_serif.scss +43 -0
  45. data/scss/pg/helpers/fonts/_sofia-pro.scss +44 -0
  46. data/scss/pg/helpers/fonts/_varela-round.scss +28 -0
  47. data/scss/pg/helpers/fonts/icon-fonts/_fontawesome.scss +34 -0
  48. data/scss/pg/helpers/fonts/icon-fonts/_foundation-accessability.scss +76 -0
  49. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_bootstrap.scss +84 -0
  50. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_core.scss +129 -0
  51. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_extras.scss +93 -0
  52. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_icons.scss +381 -0
  53. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_mixins.scss +48 -0
  54. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_path.scss +14 -0
  55. data/scss/pg/helpers/fonts/icon-fonts/fontawesome/_variables.scss +734 -0
  56. data/scss/pg/helpers/fonts/icon-fonts/foundation-accessability/_settings.scss +28 -0
  57. data/scss/pg/helpers/library/_lists.scss +462 -0
  58. data/scss/pg/helpers/mixins/_all.scss +15 -0
  59. data/scss/pg/helpers/mixins/_anchors.scss +125 -0
  60. data/scss/pg/helpers/mixins/_baseline.scss +53 -0
  61. data/scss/pg/helpers/mixins/_breakpoints.scss +35 -0
  62. data/scss/pg/helpers/mixins/_content.scss +19 -0
  63. data/scss/pg/helpers/mixins/_css-triangle.scss +70 -0
  64. data/scss/pg/helpers/mixins/_elements.scss +106 -0
  65. data/scss/pg/helpers/mixins/_module.scss +327 -0
  66. data/scss/pg/helpers/mixins/_text.scss +87 -0
  67. data/scss/pg/helpers/mixins/_units.scss +67 -0
  68. data/scss/pg/helpers/settings/_all.scss +7 -0
  69. data/scss/pg/helpers/settings/_breakpoints.scss +21 -0
  70. data/scss/pg/modules/_all.scss +9 -0
  71. data/scss/pg/modules/_behavior.scss +13 -0
  72. data/scss/pg/modules/_helpers.scss +13 -0
  73. data/scss/pg/modules/_settings.scss +13 -0
  74. data/scss/pg/modules/accordions/_all.scss +8 -0
  75. data/scss/pg/modules/accordions/_behavior.scss +5 -0
  76. data/scss/pg/modules/accordions/_helpers.scss +5 -0
  77. data/scss/pg/modules/accordions/_settings.scss +4 -0
  78. data/scss/pg/modules/buttons/_all.scss +8 -0
  79. data/scss/pg/modules/buttons/_behavior.scss +89 -0
  80. data/scss/pg/modules/buttons/_helpers.scss +7 -0
  81. data/scss/pg/modules/buttons/_settings.scss +153 -0
  82. data/scss/pg/modules/buttons/helpers/_mixins.scss +33 -0
  83. data/scss/pg/modules/forms/_all.scss +8 -0
  84. data/scss/pg/modules/forms/_behavior.bak.scss +215 -0
  85. data/scss/pg/modules/forms/_behavior.scss +215 -0
  86. data/scss/pg/modules/forms/_helpers.scss +8 -0
  87. data/scss/pg/modules/forms/_settings.scss +10 -0
  88. data/scss/pg/modules/forms/helpers/_mixins.scss +94 -0
  89. data/scss/pg/modules/forms/settings/forms.scss +19 -0
  90. data/scss/pg/modules/forms/settings/input.scss +256 -0
  91. data/scss/pg/modules/forms/settings/labels.scss +101 -0
  92. data/scss/pg/modules/lists/_all.scss +9 -0
  93. data/scss/pg/modules/lists/_behavior.scss +99 -0
  94. data/scss/pg/modules/lists/_helpers.scss +11 -0
  95. data/scss/pg/modules/lists/_settings.scss +49 -0
  96. data/scss/pg/modules/tables/_all.scss +8 -0
  97. data/scss/pg/modules/tables/_behavior.scss +79 -0
  98. data/scss/pg/modules/tables/_helpers.scss +7 -0
  99. data/scss/pg/modules/tables/_settings.scss +69 -0
  100. data/scss/pg/modules/tables/helpers/_mixins.scss +9 -0
  101. data/scss/pg/modules/tabs/_all.scss +8 -0
  102. data/scss/pg/modules/tabs/_behavior.scss +77 -0
  103. data/scss/pg/modules/tabs/_helpers.scss +7 -0
  104. data/scss/pg/modules/tabs/_settings.scss +8 -0
  105. data/scss/pg/modules/tabs/helpers/_mixins.scss +4 -0
  106. data/scss/pg/skins/_crossinghippos.scss +8 -0
  107. data/scss/pg/skins/crossinghippos/_all.scss +9 -0
  108. data/scss/pg/skins/crossinghippos/_behavior.scss +10 -0
  109. data/scss/pg/skins/crossinghippos/_helpers.scss +8 -0
  110. data/scss/pg/skins/crossinghippos/_settings.scss +9 -0
  111. data/scss/pg/skins/crossinghippos/buttons/_all.scss +9 -0
  112. data/scss/pg/skins/crossinghippos/buttons/_behavior.scss +25 -0
  113. data/scss/pg/skins/crossinghippos/buttons/_helpers.scss +7 -0
  114. data/scss/pg/skins/crossinghippos/buttons/_settings.scss +50 -0
  115. data/scss/pg/skins/crossinghippos/forms/_all.scss +9 -0
  116. data/scss/pg/skins/crossinghippos/forms/_base.scss +7 -0
  117. data/scss/pg/skins/crossinghippos/forms/_behavior.scss +259 -0
  118. data/scss/pg/skins/crossinghippos/forms/_settings.scss +29 -0
  119. data/scss/pg/skins/crossinghippos/linkbar/_all.scss +8 -0
  120. data/scss/pg/skins/crossinghippos/linkbar/_behavior.scss +73 -0
  121. data/scss/pg/skins/crossinghippos/linkbar/_helpers.scss +5 -0
  122. data/scss/pg/skins/crossinghippos/linkbar/_settings.scss +27 -0
  123. data/templates/base/manifest.rb +15 -0
  124. data/templates/base/screen.scss +39 -0
  125. data/templates/grid/manifest.rb +15 -0
  126. data/templates/grid/screen.scss +36 -0
  127. data/templates/modules/manifest.rb +15 -0
  128. data/templates/modules/screen.scss +44 -0
  129. metadata +210 -0
@@ -0,0 +1,35 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
4
+ // */
5
+ @if $trace-imports { @debug 'imported'; }
6
+
7
+ // Expects a nested array of valid expressions, for example
8
+ // $properties: (min-width,100px),(orientation,landscape)
9
+ // Use false if a value should not be rendered (0 is a valid value)
10
+ @mixin breakpoint($properties, $media: 'only screen')
11
+ {
12
+ @if $properties {
13
+
14
+ $query: '';
15
+
16
+ @if length(nth($properties,1))>1{
17
+ @each $property in $properties {
18
+ $name: nth($property,1);
19
+ $value: nth($property,2);
20
+ @if $value {
21
+ $query: '#{$query} and (#{$name}: #{$value})';
22
+ }
23
+ }
24
+ }
25
+ @else {
26
+ $name: nth($properties,1);
27
+ $value: nth($properties,2);
28
+ $query: '#{$query} and (#{$name}: #{$value})';
29
+ }
30
+
31
+ @media #{$media} #{$query} {
32
+ @content;
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,19 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
4
+ // */
5
+ @if $trace-imports { @debug 'imported'; }
6
+
7
+ @mixin is-hidden {
8
+ position: absolute;
9
+ left: -9999em;
10
+ }
11
+ @mixin is-not-hidden {
12
+ position: static;
13
+ }
14
+ @mixin is-visible($display: block) {
15
+ display: $display;
16
+ }
17
+ @mixin is-not-visible {
18
+ display: none;
19
+ }
@@ -0,0 +1,70 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
4
+ // */
5
+ @if $trace-imports { @debug 'imported'; }
6
+
7
+ @mixin tooltipTriangle($size: $base-font-size, $direction: down, $color: $color-theme)
8
+ {
9
+ border: $size/2 solid transcontainer;
10
+ display: inline-block;
11
+ content: "";
12
+ width: 0;
13
+ height: 0;
14
+ position: absolute;
15
+ @if $direction == right {
16
+ left: 100%;
17
+ border-left-color: $color;
18
+ }
19
+ @if $direction == left {
20
+ right: 100%;
21
+ border-right-color: $color;
22
+ }
23
+ @if $direction == up {
24
+ @include unit(top, $size/-2);
25
+ border-bottom-color: $color;
26
+ }
27
+ @if $direction == down {
28
+ top: 100%;
29
+ border-top-color: $color;
30
+ }
31
+
32
+ @if $direction == up {
33
+ left: 50%;
34
+ margin-left: $size/-2;
35
+ }
36
+ @if $direction == down {
37
+ left: 50%;
38
+ margin-left: $size/-2;
39
+ }
40
+ }
41
+
42
+ @mixin triangle($size: $base-font-size, $direction: right, $color: $color-theme, $where: after)
43
+ {
44
+ position: relative;
45
+ &:#{$where} {
46
+ border: $size/2 solid transcontainer;
47
+ // @include unit(border-width, $size/2);
48
+ display: inline-block;
49
+ content: "";
50
+ width: 0;
51
+ height: 0;
52
+ position: absolute;
53
+ @if $direction == right {
54
+ left: 100%;
55
+ border-left-color: $color;
56
+ }
57
+ @if $direction == left {
58
+ right: 100%;
59
+ border-right-color: $color;
60
+ }
61
+ @if $direction == up {
62
+ @include unit(top, $size/-2);
63
+ border-bottom-color: $color;
64
+ }
65
+ @if $direction == down {
66
+ top: 100%;
67
+ border-top-color: $color;
68
+ }
69
+ }
70
+ }
@@ -0,0 +1,106 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later !default; see LICENSE.txt
4
+ // *
5
+ // * Uses Hugo Giraudel's awesome Lists functions: https://github.com/HugoGiraudel
6
+ // *
7
+ // */
8
+ @if $trace-imports { @debug 'imported'; }
9
+
10
+
11
+ // Dependencies
12
+ @import "pg/helpers/library/lists";
13
+
14
+
15
+ // Returns a new element
16
+ // ==========================================================================
17
+ // @example $button: new('button', 'default');
18
+ // @example $button: new($button, 'active');
19
+ // --------------------------------------------------------------------------
20
+ // @param $properties [Literal] an arbitrary string, or an existing $element
21
+ // @param $name [String] a namespace for the new element
22
+ // --------------------------------------------------------------------------
23
+ // @return [List]
24
+
25
+ @function new($properties, $name, $is-state)
26
+ {
27
+ @if type-of($properties)!=list {
28
+ @return ($name, (), $is-state);
29
+ }
30
+ @else if type-of($properties)==list and length($properties)==1 {
31
+ @return ($name, $properties, $is-state);
32
+ }
33
+ @else {
34
+ $old_name: nth($properties, 1);
35
+ @return replace($properties, $old_name, $name);
36
+ }
37
+ }
38
+
39
+
40
+ // Placeholder function for new()
41
+ // ==========================================================================
42
+ // @example $button: clone($button, 'new-name');
43
+ //
44
+ // @param $element [List] an existing $element
45
+ // @param $name [String] a namespace for the new element
46
+ // --------------------------------------------------------------------------
47
+ // @return [List]
48
+
49
+ @function clone($element, $element-name, $is-state)
50
+ {
51
+ @return new($element, $element-name, $is-state);
52
+ }
53
+
54
+
55
+ // Returns the $element with adjusted properties
56
+ // ==========================================================================
57
+ // @example $button: change($button, (color, #fff));
58
+ //
59
+ // @param $element [List] an existing $element
60
+ // @param $property [List] a list consisting of property-name and value
61
+ // --------------------------------------------------------------------------
62
+ // @return [List]
63
+
64
+ @function change($element, $property)
65
+ {
66
+ $key: nth($property, 1);
67
+ $properties: nth($element,2);
68
+ $new_properties: ();
69
+
70
+ $item: find-list-item($properties, $key);
71
+
72
+ @if $item==false {
73
+ $new_properties: append($properties, ($property));
74
+ }
75
+ @else {
76
+ $new_properties: replace($properties, $item, $property);
77
+ }
78
+ $element: replace($element, $properties, $new_properties);
79
+
80
+ @return $element;
81
+ }
82
+
83
+
84
+ // Returns a matching element from a nested list
85
+ // ==========================================================================
86
+ // @example $button: find-list-item( ((color, blue) (border: none)), border ) => (border: none)
87
+ // @example $button: find-list-item( ((color, blue) (border: none)), border, true ) => 2
88
+ //
89
+ // @param $list [List] a nested list
90
+ // @param $key [String] the key to match
91
+ // @param $index [Boolean] return the match's index (true) or the match (false)
92
+ // --------------------------------------------------------------------------
93
+ // @return [Literal]
94
+
95
+ @function find-list-item($list, $key, $index: false)
96
+ {
97
+ $l: length($list);
98
+ @for $i from 1 through $l {
99
+ $item: nth($list,$i);
100
+ @if nth($item,1) == $key {
101
+ @return $item;
102
+ }
103
+ }
104
+
105
+ @return false;
106
+ }
@@ -0,0 +1,327 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
4
+ // */
5
+ @if $trace-imports { @debug 'imported'; }
6
+
7
+
8
+ // ==========================================================================
9
+ // Mixin for modules: sides
10
+ // ==========================================================================
11
+ // Applies margin, padding, border, outline
12
+ //
13
+ // @param $values: an array of 1 or 4 values
14
+ // @param $property: a string (e.g. padding, margin, or border)
15
+ // ==========================================================================
16
+ @mixin sides($values, $property)
17
+ {
18
+ $length: length($values);
19
+
20
+ // **
21
+ // Do not accept arrays of 2 and 3
22
+ // **
23
+ @if $length==2 or $length==3 {
24
+ @warn "Wrong value for first parameter: mixin accepts either a single value or an array of four values.";
25
+ }
26
+
27
+
28
+ @if $length==1 {
29
+ @include module-property($values, $property);
30
+ }
31
+
32
+
33
+ @if $length==4 {
34
+
35
+ $compact: true;
36
+ @each $value in $values {
37
+ @if $value==false {
38
+ $compact: false;
39
+ }
40
+ }
41
+
42
+ @if $compact {
43
+
44
+ @if nth($values, index($sides, top))==nth($values, index($sides, bottom)) and nth($values, index($sides, right))==nth($values, index($sides, left)) {
45
+ #{$property}: nth($values,1) nth($values,2);
46
+ }
47
+ @else {
48
+ @include module-property($values, $property);
49
+ }
50
+ }
51
+ @else {
52
+ @each $value in $values {
53
+
54
+ @if $value {
55
+
56
+ $i: index($values, $value);
57
+ $side: padding-#{nth($sides,$i)};
58
+
59
+ @include module-property($value, $side);
60
+ }
61
+ }
62
+ }
63
+
64
+ }
65
+ }
66
+
67
+
68
+ // ==========================================================================
69
+ // Mixin for modules: properties
70
+ // ==========================================================================
71
+ // Applies margin, padding, border, outline
72
+ //
73
+ // @param $values: a single value
74
+ // @param $property: a string (e.g. padding, margin-left, border-color) or false if nothing should be compiled
75
+ // ==========================================================================
76
+ @mixin module-property($values, $property)
77
+ {
78
+ @if $values {
79
+ #{$property}: $values;
80
+ }
81
+ }
82
+
83
+
84
+ // ==========================================================================
85
+ // Mixin for modules: display
86
+ // ==========================================================================
87
+ //
88
+ // @param $values: a list of display and vertical-align or false if nothing should be compiled
89
+ // ==========================================================================
90
+ @mixin module-display($values)
91
+ {
92
+ @if $values {
93
+
94
+ $display: nth($values,1);
95
+ $vertical-align: nth($values,1);
96
+
97
+ @if $display==inline-block {
98
+ @include inline-block($vertical-align);
99
+ }
100
+ @else {
101
+ @if $display {
102
+ @include module-property($display, display);
103
+ }
104
+ @if $vertical-align {
105
+ @include module-property($vertical-align, vertical-align);
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+
112
+ // ==========================================================================
113
+ // Mixin for modules: margin (placeholder for sides())
114
+ // ==========================================================================
115
+ // Accepts either a single value represetning all four sides,
116
+ // or a list of four values representing each individual side
117
+ //
118
+ // @param $values: a list of 1 or 4 width values or false if nothing should be compiled
119
+ // ==========================================================================
120
+ @mixin module-margin($margin)
121
+ {
122
+ @if $margin {
123
+ @include sides($margin, margin);
124
+ }
125
+ }
126
+
127
+
128
+ // ==========================================================================
129
+ // Mixin for modules: padding (placeholder for sides())
130
+ // ==========================================================================
131
+ // Accepts either a single value represetning all four sides,
132
+ // or a list of four values representing each individual side
133
+ //
134
+ // @param $values: a list of 1 or 4 width values or false if nothing should be compiled
135
+ // ==========================================================================
136
+ @mixin module-padding($padding)
137
+ {
138
+ @if $padding {
139
+ @include sides($padding, padding);
140
+ }
141
+ }
142
+
143
+
144
+ // ==========================================================================
145
+ // Mixin button border (placeholder for sides)
146
+ // ==========================================================================
147
+ // Accepts a list of three values representing width, style and color
148
+ //
149
+ // @param $values: a list of properties (width, style, color) or false if nothing should be compiled
150
+ // ==========================================================================
151
+ @mixin module-border($border)
152
+ {
153
+ $length: length($border);
154
+
155
+ @if $length>1 {
156
+ $width: nth($border,1);
157
+ $style: nth($border,2);
158
+ $color: nth($border,3);
159
+ @if $width {
160
+ border-width: $width;
161
+ }
162
+ @if $style {
163
+ border-style: $style;
164
+ }
165
+ @if $color {
166
+ border-color: $color;
167
+ }
168
+ }
169
+ @else {
170
+ @if $border {
171
+ @include module-property(#{$border}, border);
172
+ }
173
+ }
174
+ }
175
+
176
+
177
+ // ==========================================================================
178
+ // Mixin for modules: border radius
179
+ // ==========================================================================
180
+ // Accepts a list of up to four values representing all four corners
181
+ //
182
+ // @param $corner-radius: a list of width values or false if nothing should be compiled
183
+ // ==========================================================================
184
+ @mixin module-border-radius($corner-radius)
185
+ {
186
+
187
+ @if $corner-radius {
188
+ @include border-radius($corner-radius);
189
+ }
190
+ }
191
+
192
+
193
+ // ==========================================================================
194
+ // Mixin for modules: outline (placeholder for sides())
195
+ // ==========================================================================
196
+ // Accepts either a single value represetning all four sides,
197
+ // or a list of four values representing each individual side
198
+ //
199
+ // @param $values: a list of 1 or 4 width values or false if nothing should be compiled
200
+ // ==========================================================================
201
+ @mixin module-outline($outline, $outline-offset: false)
202
+ {
203
+ @if $outline {
204
+ @include sides($outline, outline);
205
+ }
206
+ @if $outline-offset {
207
+ outline-offset: $outline-offset;
208
+ }
209
+ }
210
+
211
+
212
+ // ==========================================================================
213
+ // Mixin for modules: box-shadow (placeholder for box-shadow)
214
+ // ==========================================================================
215
+ // a valid box-shadow notation is: inset|outset offset-x offset-y blur color
216
+ //
217
+ // @param $shadow: a (list of) valid shadow notation(s) or false if nothing should be compiled
218
+ // ==========================================================================
219
+ @mixin module-shadow($shadow)
220
+ {
221
+ @if $shadow {
222
+ @include box-shadow($shadow);
223
+ }
224
+ }
225
+
226
+
227
+ // ==========================================================================
228
+ // Mixin for modules: background
229
+ // ==========================================================================
230
+ //
231
+ // @param $background: a list of properties (background-color, background-image) or false if nothing should be compiled
232
+ // ==========================================================================
233
+ @mixin module-background($background)
234
+ {
235
+ @if $background {
236
+
237
+ $background-color: nth($background,1);
238
+ $background-image: nth($background,2);
239
+
240
+ @if $background-color {
241
+ background-color: $background-color;
242
+ }
243
+ @if $background-image {
244
+ @include background-image($background-image);
245
+ }
246
+ }
247
+ }
248
+
249
+
250
+ // ==========================================================================
251
+ // Mixin for modules: text
252
+ // ==========================================================================
253
+ //
254
+ // @param $text
255
+ // ==========================================================================
256
+ @mixin module-text($text)
257
+ {
258
+ @if $text {
259
+
260
+ $align: nth($text,1);
261
+ $decoration: nth($text,2);
262
+ $shadow: nth($text,3);
263
+
264
+ @if $align {
265
+ @include module-property($align, text-align);
266
+ }
267
+ @if $decoration {
268
+ @include module-property($decoration, text-decoration);
269
+ }
270
+ @if $shadow {
271
+ @include text-shadow($shadow);
272
+ }
273
+ }
274
+ }
275
+
276
+
277
+ // ==========================================================================
278
+ // Mixin for modules: text-shadow
279
+ // ==========================================================================
280
+ //
281
+ // @param $shadow
282
+ // ==========================================================================
283
+ @mixin module-text-shadow($shadow)
284
+ {
285
+ @if $shadow {
286
+ @include text-shadow($shadow);
287
+ }
288
+ }
289
+
290
+
291
+ // ==========================================================================
292
+ // Mixin for modules: type
293
+ // ==========================================================================
294
+ //
295
+ // @param $type: a list of properties (type, font-size, leading) or false if nothing should be compiled
296
+ // ==========================================================================
297
+ @mixin module-type($type)
298
+ {
299
+ @if $type {
300
+
301
+ $type-size: nth($type,2);
302
+ $type-rhythm: if(nth($type,3), nth($type,3), 1);
303
+
304
+ $type: nth($type,1);
305
+
306
+ @if $type-size and $type-size!=$base-font-size {
307
+ @include adjust-font-size-to($type-size, $type-rhythm);
308
+ }
309
+
310
+ @if extract-type-style($type) != extract-type-style($type-default) {
311
+ @include font-style($type);
312
+ }
313
+
314
+ @if extract-type-variant($type) != extract-type-variant($type-default) {
315
+ @include font-variant($type);
316
+ }
317
+
318
+ @if extract-type-weight($type) != extract-type-weight($type-default) {
319
+ @include font-weight($type);
320
+ }
321
+
322
+ @if extract-type-family($type) != extract-type-family($type-default) {
323
+ @include font-family($type);
324
+ }
325
+
326
+ }
327
+ }
@@ -0,0 +1,87 @@
1
+ // /**
2
+ // * Copyright (C) 2013 Crossing Hippos - Babs Gösgens. All rights reserved.
3
+ // * Licensed under GNU General Public License version 2 or later; see LICENSE.txt
4
+ // */
5
+ @if $trace-imports { @debug 'imported'; }
6
+
7
+
8
+ @function calculate-text-shadow($text-color, $bg-color, $down: true)
9
+ {
10
+ $lightness-text: lightness($text-color);
11
+ $lightness-background: lightness($background-color);
12
+
13
+ $text-is-darker: $lightness-text > $lightness-background;
14
+
15
+ @return false;
16
+
17
+ @if $down {
18
+ @if $text-is-darker {
19
+ }
20
+ @else {
21
+ }
22
+ }
23
+ @else {
24
+ @if $text-is-darker {
25
+ }
26
+ @else {
27
+ }
28
+ }
29
+ }
30
+ // ==========================================================================
31
+ // Mixin emboss-text-up
32
+ // --------------------------------------------------------------------------
33
+ // @param $text-color
34
+ // @param $background-color
35
+ // ==========================================================================
36
+ @mixin emboss-text-up($text-color, $background-color, $transparency: .5, $blur: 1px)
37
+ {
38
+
39
+ $lt: lightness($text-color);
40
+ $lb: lightness($background-color);
41
+
42
+ $shadow: mix($text-color,$background-color);
43
+
44
+ @if($lt>$lb) {
45
+ /*
46
+ * Dark text on light background
47
+ */
48
+ $shadow: rgba(255,255,255,$transparency);
49
+ @include text-shadow(-1px -1px $blur $shadow);
50
+ }
51
+ @if($lt<$lb) {
52
+ /*
53
+ * Light text on dark background
54
+ */
55
+ $shadow: rgba(0,0,0,$transparency);
56
+ @include text-shadow(1px 1px $blur $shadow);
57
+ }
58
+ }
59
+
60
+
61
+ // ==========================================================================
62
+ // Mixin emboss-text-down
63
+ // --------------------------------------------------------------------------
64
+ // @param $text-color
65
+ // @param $background-color
66
+ // ==========================================================================
67
+ @mixin emboss-text-down($text-color, $background-color, $transparency: .5, $blur: 1px)
68
+ {
69
+
70
+ $lt: lightness($text-color);
71
+ $lb: lightness($background-color);
72
+
73
+ @if($lt>$lb) {
74
+ /*
75
+ * Dark text on light background
76
+ */
77
+ $shadow: rgba(0,0,0,$transparency);
78
+ @include text-shadow(-1px -1px $blur $shadow);
79
+ }
80
+ @if($lt<$lb) {
81
+ /*
82
+ * Light text on dark background
83
+ */
84
+ $shadow: rgba(255,255,255,$transparency);
85
+ @include text-shadow(1px 1px $blur $shadow);
86
+ }
87
+ }