toolkit 0.2.1.3 → 0.2.2

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.
data/lib/toolkit.rb CHANGED
@@ -11,4 +11,11 @@ module Sass::Script::Functions
11
11
  result = haystack.value.gsub(needle.value, replace.value)
12
12
  Sass::Script::String.new(result)
13
13
  end
14
+
15
+ def children_of_ie_nth(input)
16
+ n = "n"
17
+ b = ""
18
+ result = input.value.gsub(n, b)
19
+ Sass::Script::Number.new(result.to_i)
20
+ end
14
21
  end
@@ -33,6 +33,11 @@
33
33
  //////////////////////////////
34
34
  @import 'toolkit/colours';
35
35
 
36
+ //////////////////////////////
37
+ // Import Triangle
38
+ //////////////////////////////
39
+ @import 'toolkit/triangle';
40
+
36
41
  //////////////////////////////
37
42
  // Import Selector Awesomeness
38
43
  //////////////////////////////
@@ -0,0 +1,26 @@
1
+ ////////////////////////
2
+ // nth-child() support for IE 7 and 8
3
+ ////////////////////////
4
+
5
+ @function nth-child($n) {
6
+
7
+ // If a single number for nth.
8
+ @if type-of($n) == number {
9
+ $nth-child: first-child;
10
+ @for $i from 2 through $n {
11
+ $nth-child: append($nth-child, #{"+*"});
12
+ }
13
+ @return #{":"}$nth-child;
14
+ }
15
+
16
+ // If a nth-child string, need to parse the string.
17
+ @else {
18
+ $n: nth(children-of-ie-nth($n), 1);
19
+ $nth-child: first-child;
20
+ @for $i from 2 through $n {
21
+ $nth-child: append($nth-child, #{"~*"});
22
+ }
23
+ @return #{":"}$nth-child;
24
+ }
25
+ }
26
+
@@ -7,19 +7,31 @@ img, video {
7
7
  }
8
8
 
9
9
  ////////////////////////
10
- // Scaling Embeds WITH NO JAVASCIPT!
11
- //
12
- // From the outrageously awesome Scott Kellum
10
+ // Fluid Embeds and whatever WITH NO JAVASCIPT!
13
11
  ////////////////////////
14
12
  $intrinsic-ratio: 16/9 !default;
15
13
  $intrinsic-ratio-width: 100% !default;
16
14
  $intrinsic-ratio-elements: '*' !default;
17
15
  $intrinsic-ratio-extend: true !default;
18
16
 
19
- @mixin intrinsic-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend) {
20
- @if not $extend {
17
+ @mixin intrinsic-ratio-parent {
21
18
  position: relative;
22
19
  height: 0;
20
+ }
21
+
22
+ @mixin intrinsic-ratio-child {
23
+ display: block;
24
+ position: absolute;
25
+ width: 100% !important; // Nuke the external styles
26
+ height: 100% !important; // Nuke the external styles
27
+ top: 0;
28
+ margin: 0;
29
+ padding: 0;
30
+ }
31
+
32
+ @mixin intrinsic-ratio($ratio: $intrinsic-ratio, $width: $intrinsic-ratio-width, $elements: $intrinsic-ratio-elements, $extend: $intrinsic-ratio-extend) {
33
+ @if not $extend {
34
+ @include intrinsic-ratio-parent;
23
35
  }
24
36
  @else {
25
37
  @extend %intrinsic-ratio-parent;
@@ -29,13 +41,7 @@ $intrinsic-ratio-extend: true !default;
29
41
  @each $element in $elements {
30
42
  > #{$element} {
31
43
  @if not $extend {
32
- display: block;
33
- position: absolute;
34
- width: 100%;
35
- height: 100%;
36
- top: 0;
37
- margin: 0;
38
- padding: 0;
44
+ @include intrinsic-ratio-child;
39
45
  }
40
46
  @else {
41
47
  @extend %intrinsic-ratio-child;
@@ -45,16 +51,9 @@ $intrinsic-ratio-extend: true !default;
45
51
  }
46
52
 
47
53
  %intrinsic-ratio-parent {
48
- position: relative;
49
- height: 0;
54
+ @include intrinsic-ratio-parent;
50
55
  }
51
56
 
52
57
  %intrinsic-ratio-child {
53
- display: block;
54
- position: absolute;
55
- width: 100%;
56
- height: 100%;
57
- top: 0;
58
- margin: 0;
59
- padding: 0;
58
+ @include intrinsic-ratio-child;
60
59
  }
@@ -34,6 +34,9 @@
34
34
  }
35
35
  }
36
36
 
37
+ //////////////////////////////
38
+ // External Link Selectors
39
+ //////////////////////////////
37
40
  @mixin style-external-links($base-url: false, $scheme: 'all') {
38
41
  @if $base-url {
39
42
  @if $scheme == 'plain' {
@@ -79,6 +82,9 @@
79
82
 
80
83
  $legacy-support-for-ie: true !default;
81
84
 
85
+ //////////////////////////////
86
+ // Syle Internal Links
87
+ //////////////////////////////
82
88
  @mixin style-internal-links {
83
89
  @if $legacy-support-for-ie {
84
90
  a {
@@ -89,4 +95,29 @@ $legacy-support-for-ie: true !default;
89
95
  a:not([href^='https://']) {
90
96
  @content;
91
97
  }
98
+ }
99
+
100
+ ////////////////////////
101
+ // nth-child() support for IE 7 and 8
102
+ ////////////////////////
103
+ @function nth-child($n) {
104
+
105
+ // If a single number for nth.
106
+ @if type-of($n) == number {
107
+ $nth-child: first-child;
108
+ @for $i from 2 through $n {
109
+ $nth-child: append($nth-child, #{"+*"});
110
+ }
111
+ @return #{":"}$nth-child;
112
+ }
113
+
114
+ // If a nth-child string, need to parse the string.
115
+ @else {
116
+ $n: nth(children-of-ie-nth($n), 1);
117
+ $nth-child: first-child;
118
+ @for $i from 2 through $n {
119
+ $nth-child: append($nth-child, #{"~*"});
120
+ }
121
+ @return #{":"}$nth-child;
122
+ }
92
123
  }
@@ -0,0 +1,46 @@
1
+ //////////////////////////////
2
+ // Draw triangles
3
+ //////////////////////////////
4
+
5
+ @mixin triangle($color: #000, $height: 1em, $width: 1em, $angle: 0) {
6
+
7
+ // offset 45deg to make each side start at 0
8
+ $deg: $angle + 45;
9
+ // if units, remove units
10
+ @if unit($deg) == deg {
11
+ $deg: $deg / 1deg;
12
+ }
13
+ // shift to be on a scale from 0 to 90.
14
+ @while $deg > 90 {
15
+ $deg: $deg - 90;
16
+ }
17
+ @while $deg < 0 {
18
+ $deg: $deg + 90;
19
+ }
20
+ // Get a ratio of 90 to multiply by.
21
+ $deg: $deg / 90;
22
+
23
+ // make sure metrics are reset
24
+ display: block;
25
+ width: 0;
26
+ height: 0;
27
+ border: 0 solid transparent;
28
+
29
+ // run through sides
30
+ @if $angle <= 45 or $angle > 315 {
31
+ border-bottom-color: $color;
32
+ border-width: 0 ($width * abs($deg - 1)) $height ($width * $deg);
33
+ }
34
+ @if $angle > 45 and $angle <= 135 {
35
+ border-left-color: $color;
36
+ border-width: ($height * $deg) 0 ($height * abs($deg - 1)) $width;
37
+ }
38
+ @if $angle > 135 and $angle <= 225 {
39
+ border-top-color: $color;
40
+ border-width: $height ($width * $deg) 0 ($width * abs($deg - 1));
41
+ }
42
+ @if $angle > 225 and $angle <= 315 {
43
+ border-right-color: $color;
44
+ border-width: ($height * abs($deg - 1)) $width ($height * $deg) 0;
45
+ }
46
+ }
metadata CHANGED
@@ -5,18 +5,18 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- - 3
10
- version: 0.2.1.3
8
+ - 2
9
+ version: 0.2.2
11
10
  platform: ruby
12
11
  authors:
13
12
  - Sam Richard
13
+ - Scott Kellum
14
14
  - Mason Wendell
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-11-29 00:00:00 -05:00
19
+ date: 2011-12-26 00:00:00 -05:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -43,8 +43,8 @@ dependencies:
43
43
  segments:
44
44
  - 1
45
45
  - 0
46
- - 1
47
- version: 1.0.1
46
+ - 5
47
+ version: 1.0.5
48
48
  type: :runtime
49
49
  version_requirements: *id002
50
50
  - !ruby/object:Gem::Dependency
@@ -56,8 +56,8 @@ dependencies:
56
56
  - !ruby/object:Gem::Version
57
57
  segments:
58
58
  - 2
59
- - 5
60
- version: "2.5"
59
+ - 6
60
+ version: "2.6"
61
61
  type: :runtime
62
62
  version_requirements: *id003
63
63
  - !ruby/object:Gem::Dependency
@@ -70,13 +70,14 @@ dependencies:
70
70
  segments:
71
71
  - 0
72
72
  - 0
73
- - 15
74
- version: 0.0.15
73
+ - 17
74
+ version: 0.0.17
75
75
  type: :runtime
76
76
  version_requirements: *id004
77
77
  description: Toolkit for Progressive Enhancement and Responsive Web Design
78
78
  email:
79
79
  - sam@snug.ug
80
+ - scott@scottkellum.com
80
81
  - mason@zivtech.com
81
82
  executables: []
82
83
 
@@ -88,11 +89,13 @@ files:
88
89
  - lib/toolkit.rb
89
90
  - stylesheets/_toolkit.scss
90
91
  - stylesheets/toolkit/_border-box.scss
92
+ - stylesheets/toolkit/_children-of-ie.scss
91
93
  - stylesheets/toolkit/_clearfix.scss
92
94
  - stylesheets/toolkit/_colours.scss
93
95
  - stylesheets/toolkit/_fluid-media.scss
94
96
  - stylesheets/toolkit/_pe.scss
95
97
  - stylesheets/toolkit/_selectors.scss
98
+ - stylesheets/toolkit/_triangle.scss
96
99
  - stylesheets/toolkit/_vertical-center.scss
97
100
  - templates/project/_base.scss
98
101
  - templates/project/manifest.rb