toolkit 1.3.8 → 2.0.0.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -7
  2. data/lib/toolkit.rb +1 -13
  3. data/stylesheets/_toolkit.scss +12 -68
  4. data/stylesheets/toolkit/_clearfix.scss +11 -95
  5. data/stylesheets/toolkit/_colors.scss +89 -1
  6. data/stylesheets/toolkit/_element-query.scss +13 -5
  7. data/stylesheets/toolkit/_fonts.scss +26 -8
  8. data/stylesheets/toolkit/_intrinsic-ratio.scss +15 -10
  9. data/stylesheets/toolkit/_kickstart.scss +14 -0
  10. data/stylesheets/toolkit/_nested-context.scss +8 -7
  11. data/stylesheets/toolkit/_pe.scss +19 -226
  12. data/stylesheets/toolkit/_selectors.scss +0 -25
  13. data/stylesheets/toolkit/_settings.scss +90 -0
  14. data/stylesheets/toolkit/_triangle.scss +7 -2
  15. data/stylesheets/toolkit/_viewport.scss +6 -16
  16. metadata +46 -105
  17. data/stylesheets/_toolkit-no-css.scss +0 -69
  18. data/stylesheets/toolkit/_border-box.scss +0 -6
  19. data/stylesheets/toolkit/_box-sizing.scss +0 -42
  20. data/stylesheets/toolkit/_carousel.scss +0 -155
  21. data/stylesheets/toolkit/_children-of-ie.scss +0 -26
  22. data/stylesheets/toolkit/_colours.scss +0 -102
  23. data/stylesheets/toolkit/_debug.scss +0 -25
  24. data/stylesheets/toolkit/_equal-height-columns.scss +0 -56
  25. data/stylesheets/toolkit/_fluid-media.scss +0 -7
  26. data/stylesheets/toolkit/_vertical-center.scss +0 -23
  27. data/templates/box-sizing/behaviors/box-sizing/boxsizing.htc +0 -399
  28. data/templates/box-sizing/behaviors/box-sizing/boxsizing.php +0 -23
  29. data/templates/box-sizing/manifest.rb +0 -4
  30. data/templates/project/_base.scss +0 -26
  31. data/templates/project/manifest.rb +0 -57
  32. data/templates/rwd/_base.scss +0 -27
  33. data/templates/rwd/manifest.rb +0 -60
  34. data/templates/shared/_design.scss +0 -9
  35. data/templates/shared/_extendables.scss +0 -6
  36. data/templates/shared/_functions.scss +0 -5
  37. data/templates/shared/_ie-design.scss +0 -9
  38. data/templates/shared/_ie-layout.scss +0 -9
  39. data/templates/shared/_layout.scss +0 -9
  40. data/templates/shared/_mixins.scss +0 -5
  41. data/templates/shared/_print-design.scss +0 -9
  42. data/templates/shared/_print-layout.scss +0 -9
  43. data/templates/shared/_style-guide.scss +0 -10
  44. data/templates/shared/_variables.scss +0 -5
  45. data/templates/shared/ie.scss +0 -32
  46. data/templates/shared/print.scss +0 -28
  47. data/templates/shared/style.scss +0 -31
@@ -0,0 +1,14 @@
1
+ *, *:before, *:after {
2
+ @if mixin-exists('box-sizing') {
3
+ @include box-sizing('border-box');
4
+ }
5
+ @else {
6
+ -moz-box-sizing: border-box;
7
+ box-sizing: border-box;
8
+ }
9
+ }
10
+
11
+ img, video {
12
+ max-width: 100%;
13
+ height: auto;
14
+ }
@@ -1,12 +1,10 @@
1
- $nested-context-contexts: 100% !default;
2
- $nested-context-position: left !default;
3
-
4
1
  // simple function to find the context of a nested percentage.
5
- @function nested-context($contexts: $nested-context-contexts) {
6
-
2
+ @function nested-context($contexts: null) {
3
+ $contexts: if($contexts !== null, $contexts, toolkit-get('nested context contexts'));
4
+
7
5
  // First level deep is always 100%
8
6
  $percentage: 100%;
9
-
7
+
10
8
  // Loop through each level
11
9
  @each $context in $contexts {
12
10
  // Invert the percentage to find context
@@ -17,7 +15,10 @@ $nested-context-position: left !default;
17
15
  }
18
16
 
19
17
  // mixin to make things easier
20
- @mixin nested-context($contexts: $nested-context-contexts, $position: $nested-context-position) {
18
+ @mixin nested-context($contexts: null, $position: null) {
19
+ $contexts: if($contexts !== null, $contexts, toolkit-get('nested context contexts'));
20
+ $position: if($position !== null, $position, toolkit-get('nestex context position'));
21
+
21
22
  width: nested-context($contexts);
22
23
  @if $position == "center" {
23
24
  position: relative;
@@ -3,10 +3,15 @@
3
3
  //
4
4
  // - $feature: Modernizr feature (base CSS class name)
5
5
  ////////////////////////
6
- @import "compass/typography/text/replacement";
6
+ @mixin enhance-with($features) {
7
+ $ft: '';
8
+ @each $feature in $features {
9
+ $ft: $ft + '.#{$feature}, '
10
+ }
11
+
12
+ $ft: str-slice($ft, -2);
7
13
 
8
- @mixin enhance-with($feature) {
9
- .#{$feature} & {
14
+ .#{$ft} & {
10
15
  @content;
11
16
  }
12
17
  }
@@ -16,235 +21,23 @@
16
21
  //
17
22
  // - $feature: Modernizr feature (base CSS class name)
18
23
  ////////////////////////
19
- @mixin degrade-from($feature, $no-js: true) {
24
+ @mixin degrade-from($features, $no-js: null) {
25
+ $ft: '';
26
+ @each $feature in $features {
27
+ $ft: $ft + '.no-#{$feature}, '
28
+ }
29
+
30
+ $no-js: if($no-js !== null, $no-js, toolkit-get('degrade from javascript'));
31
+
20
32
  @if $feature == 'js' or not $no-js {
21
- .no-#{$feature} & {
33
+ #{$ft} & {
22
34
  @content;
23
35
  }
24
36
  }
25
37
  @else {
26
- .no-#{$feature} &,
38
+ #{$ft} &,
27
39
  .no-js & {
28
40
  @content;
29
41
  }
30
42
  }
31
- }
32
-
33
- ////////////////////////
34
- // Progressive Enhancement Text Replace Mixin
35
- //
36
- // - $png-path: The path to the pngs for the image sprite, including the *.png (just like normal image sprites)
37
- // - $sprite: The name of the sprite you want to use (this is the file name without extension)
38
- // - $inline-svg: Switches between a Base64 encoded SVG or a normal url() for the SVG. Default to true
39
- // - $with-dimensions: Switches between including dimensions (height/width for all and background-size for SVG) or not. Defaults to true.
40
- // - $inline: Whether or not the containing selector is an inline element. Defaults to false.
41
- ////////////////////////
42
- @import "compass/utilities/sprites";
43
-
44
- $replace-text-pe-method: 'svg' !default;
45
- $replace-text-pe-inline-svg: true !default;
46
- $replace-text-pe-with-dimensions: true !default;
47
- $replace-text-inline-element: false !default;
48
-
49
- @mixin replace-text-pe($img-path, $sprite, $method: $replace-text-pe-method, $inline-svg: $replace-text-pe-inline-svg, $with-dimensions: $replace-text-pe-with-dimensions, $inline-element: $replace-text-inline-element) {
50
- // Hide text. Use squish-text() if the element is inline
51
- @if $inline-element {
52
- @extend %replace-text-pe-squish;
53
- }
54
- @else {
55
- @extend %replace-text-pe-hide;
56
- }
57
-
58
- @if $method == 'svg' {
59
- @include svg-background($img-path, $sprite, $inline-svg, $with-dimensions);
60
- }
61
- @else if $method == 'retina' {
62
- @include retina-background($img-path, $sprite, $with-dimensions);
63
- }
64
-
65
- }
66
-
67
- //////////////////////////////
68
- // SVG Background Image with Fallback
69
- //////////////////////////////
70
- @mixin svg-background($img-path, $sprite, $inline-svg: $replace-text-pe-inline-svg, $with-dimensions: $replace-text-pe-with-dimensions) {
71
- $png-path: $img-path + '/*.png';
72
- $sprite-map: sprite-map($png-path);
73
-
74
- // Build SVG file name
75
- $svg-file: $img-path + '/#{$sprite}.svg';
76
-
77
- // Default Sprite File
78
- $sprite-file: '' !default;
79
-
80
- @if $with-dimensions {
81
- // Get Sprite File for Height/Width
82
- $sprite-file: sprite-file($sprite-map, $sprite);
83
-
84
- // Put the height/width of the image in
85
- width: image-width($sprite-file);
86
- height: image-height($sprite-file);
87
- }
88
-
89
- @include enhance-with('svg') {
90
- // Inline the SVG so that advanced browsers and future tech doesn't need the extra HTTP requests for the SVG
91
- @if $inline-svg {
92
- background-image: inline-image($svg-file);
93
- }
94
- @else {
95
- background-image: image-url($svg-file);
96
- }
97
- // No repeating backgrounds, please
98
- background-repeat: no-repeat;
99
- // Set background size to ensure that our SVG is the right size.
100
- @if $with-dimensions {
101
- background-size: image-width($sprite-file) image-height($sprite-file);
102
- }
103
- }
104
-
105
- // Degrade from SVG
106
- @include degrade-from('svg') {
107
- // Extend the Sprite Background
108
- @extend %#{sprite-map-name($sprite-map)}-image-map;
109
- // Call the Sprite'd image's position.
110
- @include sprite($sprite-map, $sprite);
111
- }
112
- }
113
-
114
- //////////////////////////////
115
- // Retina Background Image with Fallback
116
- //////////////////////////////
117
- @mixin retina-background($img-path, $sprite, $with-dimensions: $replace-text-pe-with-dimensions) {
118
- $png-path: $img-path + '/*.png';
119
- $sprite-map: sprite-map($png-path);
120
-
121
- $png2x-path: $img-path + '_2x/*.png';
122
- $retina-map: sprite-map($png2x-path);
123
-
124
- // Default Sprite File
125
- $sprite-file: '' !default;
126
-
127
- @if $with-dimensions {
128
- // Get Sprite File for Height/Width
129
- $sprite-file: sprite-file($sprite-map, $sprite);
130
-
131
- width: image-width($sprite-file);
132
- height: image-height($sprite-file);
133
- }
134
-
135
- .ie6 &,
136
- .ie7 &,
137
- .ie8 & {
138
- @extend %#{sprite-map-name($sprite-map)}-image-map-fallback;
139
- @include sprite($sprite-map, $sprite);
140
- }
141
-
142
- //////////////////////////////
143
- // Ugly Hack
144
- //
145
- // Due to a bug plus a design decision, I cannot extend the background image
146
- // like I would like to or you would do by hand. This sucks, but it's the
147
- // only way to get it to work for now.
148
- //////////////////////////////
149
- @media (max-resolution: 1.4dppx), (-webkit-max-device-pixel-ratio: 1.4), (max--moz-device-pixel-ratio: 1.4), (max-resolution: 134.4dpi) {
150
- background: {
151
- image: $sprite-map;
152
- repeat: no-repeat;
153
- }
154
- @include sprite($sprite-map, $sprite);
155
- }
156
- @media (min-resolution: 1.5dppx), (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
157
- background: {
158
- image: $retina-map;
159
- repeat: no-repeat;
160
- }
161
- @if $with-dimensions {
162
- background-size: image-width($sprite-file) image-height($sprite-file);
163
- }
164
- @include sprite($retina-map, $sprite);
165
- }
166
-
167
- //////////////////////////////
168
- // Actual Hotness
169
- //
170
- // Do to a bug plus a design decision, I cannot extend the background image
171
- // like I would like to or you would do by hand. This is how it'll work
172
- // when I can.
173
- //////////////////////////////
174
- // @media (-webkit-max-device-pixel-ratio: 1.4), (max--moz-device-pixel-ratio: 1.4), (-o-max-device-pixel-ratio: 7/5), (min-resolution: 1.4dppx), (min-resolution: 134.4dpi) {
175
- // @extend %#{sprite-map-name($png-path)}-image-map;
176
- // @include sprite($png-path, $sprite)
177
- // }
178
- // @media (-webkit-max-device-pixel-ratio: 1.5), (max--moz-device-pixel-ratio: 1.5), (-o-max-device-pixel-ratio: 3/2), (min-resolution: 1.5dppx), (min-resolution: 144dpi) {
179
- // @extend %#{sprite-map-name($png2x-path)}-image-map;
180
- // @include sprite($retina-map, $sprite);
181
- // @if $with-dimensions {
182
- // background-size: image-width($sprite-file) image-height($sprite-file);
183
- // }
184
- // }
185
- }
186
-
187
- //////////////////////////////
188
- // Sprite Map Generator
189
- //
190
- // Need a custom mixin to create extendable classes classes for background image for sprites because dynamic mixin names don't work.
191
- //
192
- // - $png-path: The path to the pngs for the image sprite, including the *.png (just like normal image sprites)
193
- //////////////////////////////
194
- @mixin sprite-map-generator($img-path, $method: $replace-text-pe-method) {
195
- $png-path: $img-path + '/*.png';
196
- $png-path: sprite-map($png-path);
197
-
198
- @if $method == 'retina' {
199
- $png2x-path: $img-path + '_2x/*.png';
200
- $png2x-path: sprite-map($png2x-path);
201
-
202
- %#{sprite-map-name($png-path)}-image-map-fallback {
203
- background: {
204
- image: $png-path;
205
- repeat: no-repeat;
206
- }
207
- }
208
-
209
- @media (max-resolution: 1.4dppx), (-webkit-max-device-pixel-ratio: 1.4), (max--moz-device-pixel-ratio: 1.4), (max-resolution: 134.4dpi) {
210
- %#{sprite-map-name($png-path)}-image-map {
211
- background: {
212
- image: $png-path;
213
- repeat: no-repeat;
214
- }
215
- }
216
- }
217
- @media (min-resolution: 1.5dppx), (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
218
- %#{sprite-map-name($png2x-path)}-image-map {
219
- background: {
220
- image: $png2x-path;
221
- repeat: no-repeat;
222
- }
223
- }
224
- }
225
- }
226
- @else {
227
- %#{sprite-map-name($png-path)}-image-map {
228
- background: {
229
- image: $png-path;
230
- repeat: no-repeat;
231
- }
232
- }
233
- }
234
-
235
-
236
- }
237
-
238
- //////////////////////////////
239
- // Extendable Class for Squish Text mixin
240
- //////////////////////////////
241
- %replace-text-pe-squish {
242
- @include squish-text();
243
- }
244
-
245
- //////////////////////////////
246
- // Extendable Class for Hide Text mixin
247
- //////////////////////////////
248
- %replace-text-pe-hide {
249
- @include hide-text();
250
- }
43
+ }
@@ -89,29 +89,4 @@ $legacy-support-for-ie: $legacy-support-for-ie6 or $legacy-support-for-ie7 or $l
89
89
  a:not([href^='https://']) {
90
90
  @content;
91
91
  }
92
- }
93
-
94
- ////////////////////////
95
- // nth-child() support for IE 7 and 8
96
- ////////////////////////
97
- @function nth-child($n) {
98
-
99
- // If a single number for nth.
100
- @if type-of($n) == number {
101
- $nth-child: first-child;
102
- @for $i from 2 through $n {
103
- $nth-child: append($nth-child, #{"+*"});
104
- }
105
- @return #{":"}$nth-child;
106
- }
107
-
108
- // If a nth-child string, need to parse the string.
109
- @else {
110
- $n: nth(children-of-ie-nth($n), 1);
111
- $nth-child: first-child;
112
- @for $i from 2 through $n {
113
- $nth-child: append($nth-child, #{"~*"});
114
- }
115
- @return #{":"}$nth-child;
116
- }
117
92
  }
@@ -0,0 +1,90 @@
1
+ //////////////////////////////
2
+ // Default Settings
3
+ //////////////////////////////
4
+ $Toolkit-Settings: (
5
+ 'clearfix extend': false,
6
+ 'color stack amounts': 25% 50% 75% 85% 90%,
7
+ 'tint color': #fff,
8
+ 'shade color': #000,
9
+ 'color scale shades': 6,
10
+ 'extend ligatures': false,
11
+ 'fade in duration': 1s,
12
+ 'fade in loading class': '.wf-loading',
13
+ 'intrinsic ratio': 16/9,
14
+ 'intrinsic ratio width': 100%,
15
+ 'intrinsic ratio elements': '> *',
16
+ 'intrinsic ratio direction': top,
17
+ 'intrinsic ratio extend': false,
18
+ 'nested context contexts': 100%,
19
+ 'nested context position': left,
20
+ 'degrade from javascript': false,
21
+ 'triangle color': #000,
22
+ 'triangle height': 1em,
23
+ 'triangle width': 1em,
24
+ 'triangle angle': 0
25
+ );
26
+
27
+ //////////////////////////////
28
+ // User Settings
29
+ //////////////////////////////
30
+ $toolkit: () !default;
31
+
32
+ //////////////////////////////
33
+ // Has Setting
34
+ //////////////////////////////
35
+ //////////////////////////////
36
+ // Has Setting
37
+ //////////////////////////////
38
+ @function toolkit-has($setting) {
39
+ @if map-has-key($toolkit, $setting) {
40
+ @return true;
41
+ }
42
+ @else {
43
+ @return false;
44
+ }
45
+ }
46
+
47
+ //////////////////////////////
48
+ // Get Settings
49
+ //////////////////////////////
50
+ @function toolkit-get($setting) {
51
+ @if toolkit-has($setting) {
52
+ @return map-get($toolkit, $setting);
53
+ }
54
+ @else {
55
+ @return map-get($Toolkit-Settings, $setting);
56
+ }
57
+ }
58
+
59
+ //////////////////////////////
60
+ // Set Settings
61
+ //////////////////////////////
62
+ @function toolkit-set($setting, $value) {
63
+ @if str-index($setting, '-') > 0 {
64
+ @warn "Toolkit settings should contain spaces, not dashes. Please replace dashes with spaces. Settings will not work as expected until changed.";
65
+ }
66
+ $toolkit: map-merge($toolkit, ($setting: $value)) !global;
67
+ @return true;
68
+ }
69
+
70
+ @mixin toolkit-change($setting, $value) {
71
+ $toolkit-change: toolkit-set($setting, $value);
72
+ }
73
+
74
+ //////////////////////////////
75
+ // Remove Setting
76
+ //////////////////////////////
77
+ @function toolkit-reset($setting) {
78
+ $Return: ();
79
+
80
+ @each $Key, $Value in $toolkit {
81
+ $Return: if($setting == $Key, $Return, map-merge($Return, ($Key: $Value)));
82
+ }
83
+
84
+ $toolkit: $Return !global;
85
+ @return true;
86
+ }
87
+
88
+ @mixin toolkit-reset($setting) {
89
+ $toolkit-reset: toolkit-reset($setting);
90
+ }
@@ -2,8 +2,13 @@
2
2
  // Draw triangles
3
3
  //////////////////////////////
4
4
 
5
- @mixin triangle($color: #000, $height: 1em, $width: 1em, $angle: 0) {
6
-
5
+ @mixin triangle($color: null, $height: null, $width: null, $angle: null) {
6
+
7
+ $color: if($color !== null, $color, toolkit-get('triangle color'));
8
+ $height: if($height !== null, $height, toolkit-get('triangle height'));
9
+ $width: if($width !== null, $width, toolkit-get('triangle width'));
10
+ $angle: if($angle !== null, $angle, toolkit-get('triangle angle'));
11
+
7
12
  @if nth($angle, 1) == "top" or nth($angle, 1) == "bottom" {
8
13
  $angle: "#{$angle}";
9
14
  }