accoutrement 1.0.0.beta.7 → 1.0.0.beta.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3778f9602fcebf0b5894cd6ec09eb1ad3c73d84e
4
- data.tar.gz: 91bb0d3f17ced33866279929b3fada6bb2565b6a
3
+ metadata.gz: 9e5e06914bdd8bff64a1ad88db0d27de9d1b2608
4
+ data.tar.gz: d1c27387540234d5a57a8deafb04df4e930b1f5e
5
5
  SHA512:
6
- metadata.gz: 34aa27edbc83b7433037875f9bd2213cdce55059e5cefddc1c008e43c308afa41ac3e10fa2eddc9b6ba811ba9f200e2cd6ddaadace6a51438af1220b1e47d2ff
7
- data.tar.gz: c256634aef3cbc6f164a214332790cd03c8ad5359e1cffa855942b6ad7960db71a2f21a7c2fabef22e16bfd40b3845ec837422d726953f810c1f1751495087af
6
+ metadata.gz: 0cda7513e981e15f9de06674b62326cf1276a4c041580fdf72beaedabf2005823421582d1156078a0b36d3116774b79f9c4d7d04c5a98183e32dec45c1050138
7
+ data.tar.gz: 6fc03b6752d59ad571326460362b287b5a13865a6d77ab71716b5bcf2ec494ec22495c6e3b27549745e04c6355071c7d774b1f5451358abb11ca8acc5a6cec89
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.beta.6
1
+ 1.0.0.beta.7
@@ -1,6 +1,12 @@
1
1
  // Color Toolkit
2
2
  // =============
3
3
 
4
+ @import "compass/utilities/color/contrast";
5
+
6
+
7
+ // Config
8
+ // ------
9
+
4
10
  $colors: () !default;
5
11
 
6
12
 
@@ -17,14 +23,16 @@ $colors: () !default;
17
23
  // Color
18
24
  // -----
19
25
  // Access your color pallette
20
- @function color(
21
- $color
22
- ) {
23
- $get: map-get($colors, $color) or $color;
24
- $base: nth($get, 1);
25
- $adjust: if(length($get) > 1, nth($get, 2), ());
26
+ @function color($color) {
27
+ // Parse arguments
28
+ $color: map-get($colors, $color) or $color;
29
+ $base: nth($color, 1);
30
+ $adjust: if(length($color) > 1, nth($color, 2), ());
31
+
32
+ // Recursive check
26
33
  $color: if(map-has-key($colors, $base), color($base), $base);
27
34
 
35
+ // Adjustments
28
36
  @each $function, $values in $adjust {
29
37
  @if function-exists($function) {
30
38
  $color: call($function, $color, $values...)
@@ -35,3 +43,10 @@ $colors: () !default;
35
43
 
36
44
  @return $color;
37
45
  }
46
+
47
+
48
+ // Contrast
49
+ // --------
50
+ @function contrast($color) {
51
+ @return contrast-color(color($color));
52
+ }
@@ -13,7 +13,7 @@ $icons: ();
13
13
  ) {
14
14
  &::#{$location} {
15
15
  @extend %icon;
16
- content: map-get($icons, $name);
16
+ content: icon($name);
17
17
  @content;
18
18
  }
19
19
  }
@@ -21,10 +21,14 @@ $icons: ();
21
21
 
22
22
  // Icon [function]
23
23
  // ---------------
24
- @function icon(
25
- $name
26
- ) {
27
- @return map-get($icons, $name),
24
+ @function icon($icon) {
25
+ $icon: map-get($icons, $icon) or $icon;
26
+
27
+ @if map-has-key($icons, $icon) {
28
+ $icon: icon($icon);
29
+ }
30
+
31
+ @return $icon;
28
32
  }
29
33
 
30
34
 
@@ -35,7 +39,7 @@ $icons: ();
35
39
  ) {
36
40
  @each $name, $value in $map {
37
41
  @if map-has-key($icons, $value) {
38
- $value: map-get($icons, $value);
42
+ $value: icon($value);
39
43
  }
40
44
  [data-icon='#{$name}']:before { content: '#{$value}'; }
41
45
  }
@@ -99,8 +99,38 @@
99
99
  #{$key} {
100
100
  @include render($value);
101
101
  }
102
+ } @else if $key == 'extend' {
103
+ @extend #{$value};
102
104
  } @else {
103
105
  #{$key}: $value;
104
106
  }
105
107
  }
106
108
  }
109
+
110
+
111
+ // Parse
112
+ // -----
113
+ @function parse(
114
+ $shorthand,
115
+ $keywords
116
+ ){
117
+ @if type-of($shorthand) == map {
118
+ @return $shorthand;
119
+ } @else {
120
+ $return: ();
121
+
122
+ @each $item in $shorthand {
123
+ @if type-of($item) == map {
124
+ $return: map-merge($return, $item);
125
+ } @else {
126
+ @each $setting, $options in $keywords {
127
+ @if index($options, $item) {
128
+ $return: map-merge($return, ($setting: $item));
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ @return $return;
135
+ }
136
+ }
@@ -3,7 +3,7 @@
3
3
 
4
4
  @import "compass/typography/vertical_rhythm";
5
5
 
6
- $_ratio-options: (
6
+ $ratio-options: (
7
7
  linear : linear,
8
8
  octave : 2,
9
9
  major-seventh : 15/8,
@@ -19,61 +19,41 @@ $_ratio-options: (
19
19
  minor-second : 16/15,
20
20
  );
21
21
 
22
+ $base-size: $base-font-size !default;
22
23
  $ratio: fifth !default;
23
24
 
24
25
 
25
26
  // Sizes
26
27
  // -----
27
- $font-sizes: (
28
+ $sizes: (
29
+ normal: 0,
30
+ rhythm: 1,
31
+
28
32
  h1: 4,
29
33
  h2: 3,
30
34
  h3: 2,
31
- line: 1,
32
- normal: 0,
33
- small: -1,
34
- smaller: -2,
35
- );
36
-
37
- $sizes: (
38
- gutter: 1,
39
- );
40
-
41
35
 
42
- // Sizes
43
- // -----
44
- @mixin sizes(
45
- $map
46
- ) {
47
- $sizes: map-merge($sizes, $map) !global;
48
- }
36
+ small: -1,
49
37
 
38
+ gutter: rhythm,
39
+ column: 4,
40
+ shim: -2,
50
41
 
51
- // Sizes
52
- // -----
53
- @mixin font-sizes(
54
- $map
55
- ) {
56
- $font-sizes: map-merge($font-sizes, $map) !global;
57
- }
42
+ corners: shim,
43
+ );
58
44
 
59
45
 
60
- // Make Size
61
- // ---------
62
- @function _make-size(
63
- $size,
64
- $root: $base-font-size,
65
- $ratio: $ratio
46
+ // Rem
47
+ // ---
48
+ @function _rem(
49
+ $size
66
50
  ) {
67
- $_return: false;
68
-
69
- @if type-of($ratio) == string {
70
- $ratio: map-get($_ratio-options, $ratio);
71
- }
51
+ $_return: $size;
72
52
 
73
- @if $ratio == linear {
74
- $_return: round($root * $size);
75
- } @else {
76
- $_return: round($root * pow($ratio, $size));
53
+ @if type-of($size) == number
54
+ and not unitless($size)
55
+ and unit($size) != rem {
56
+ $_return: convert-length($size, rem);
77
57
  }
78
58
 
79
59
  @return $_return;
@@ -83,40 +63,30 @@ $sizes: (
83
63
  // Get Size
84
64
  // --------
85
65
  @function _get-size(
86
- $size,
87
- $unit: $rhythm-unit,
88
- $scale: $sizes
66
+ $size
89
67
  ) {
90
- @if type-of($size) == string {
91
- $size: map-get($scale, $size);
92
- }
93
-
94
- @if $size and unitless($size) {
95
- $size: _make-size($size);
96
- }
68
+ $size: map-get($sizes, $size) or $size;
97
69
 
98
- @if $unit == rem {
99
- $size: _rem($size);
70
+ @if map-has-key($sizes, $size) {
71
+ $size: _get-size($size);
100
72
  }
101
73
 
102
74
  @return $size;
103
75
  }
104
76
 
105
77
 
106
- // Rem
107
- // ---
108
- @function _rem(
109
- $size
78
+ // Get Ratio
79
+ // ---------
80
+ @function _get-ratio(
81
+ $ratio: $ratio
110
82
  ) {
111
- $_return: $size;
83
+ $ratio: map-get($ratio-options, $ratio) or $ratio;
112
84
 
113
- @if type-of($size) == number
114
- and not unitless($size)
115
- and unit($size) != rem {
116
- $_return: convert-length($size, rem);
85
+ @if map-has-key($ratio-options, $ratio) {
86
+ $ratio: _get-ratio($ratio);
117
87
  }
118
88
 
119
- @return $_return;
89
+ @return $ratio;
120
90
  }
121
91
 
122
92
 
@@ -126,39 +96,50 @@ $sizes: (
126
96
  $size,
127
97
  $unit: $rhythm-unit
128
98
  ) {
129
- @return _get-size($size, $unit, $sizes);
99
+ $size: _get-size($size);
100
+
101
+ @if type-of($size) == number {
102
+ @if unitless($size) {
103
+ $_ratio: _get-ratio($ratio);
104
+ $size: round($base-size * pow($_ratio, $size));
105
+ }
106
+
107
+ @if $unit == rem {
108
+ $size: _rem($size);
109
+ }
110
+ }
111
+
112
+ @return $size;
130
113
  }
131
114
 
132
115
 
133
- // Font Size (function)
134
- // --------------------
135
- @function font-size(
136
- $size,
137
- $unit: $rhythm-unit
116
+ // Get Font Size
117
+ // -------------
118
+ @function get-font-size(
119
+ $size: normal,
120
+ $lines: false
138
121
  ) {
139
- @return _get-size($size, $unit, $font-sizes);
122
+ @return (
123
+ font-size: size($size),
124
+ line-height: rhythm(lines-for-font-size(size($size, px))),
125
+ );
140
126
  }
141
127
 
142
128
 
143
- // Font Size (mixin)
144
- // -----------------
129
+ // Font Size
130
+ // ---------
145
131
  @mixin font-size(
146
132
  $size: normal,
147
133
  $lines: false
148
134
  ){
149
- $_output: _get-font-sizes($size, $lines);
150
- @include adjust-font-size-to($_output...);
135
+ @include render(get-font-size($size, $lines));
151
136
  }
152
137
 
153
138
 
154
- // Get Font Sizes
155
- // --------------
156
- @function _get-font-sizes(
157
- $size: normal,
158
- $lines: false
159
- ) {
160
- $_return: if($lines, (lines: $lines), ());
161
- $size: font-size($size, px);
139
+ // Square
140
+ // ------
162
141
 
163
- @return map-merge($_return, (to_size: $size));
142
+ @mixin square($size) {
143
+ height: size($size);
144
+ width: size($size);
164
145
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: accoutrement
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.7
4
+ version: 1.0.0.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric M. Suzanne