accoutrement 1.0.0.beta.5 → 1.0.0.beta.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6113c8ffa40d18031fb884cc8ec0ab9bca40e9da
4
- data.tar.gz: 5ff1394a1d64ebcfefb2f203e47df0e461178ec9
3
+ metadata.gz: 34801ed7c6e6efa12bf103f41a65631e2800e4ae
4
+ data.tar.gz: c46c5cdf1a77cdd330218d10f785ff34ff0cadb9
5
5
  SHA512:
6
- metadata.gz: fc3f9022a44e6f7293d12db70f188112ab6c86bd973dea42e3d1bab556757740650f388c27b07b39d967360fa705b7dc21d85edd6d2d8e2edc51ffe82736f2d1
7
- data.tar.gz: d7eea6510ac33b7b5589158abefbb66cdef24aea852d67f3dffd3da4245ed58f86baeb4efe9630dde34f8801798cd1efbd2a0a0f10288cc6f9506a3766d561b2
6
+ metadata.gz: 1dff82ba0c3addbe14cd01c00dfb0e6e44b75ceeb2692701909bfc33ce854eeb9504feffc21f43acb75173485705bcdcc98956955724761c4edd16382d9b31d2
7
+ data.tar.gz: f1341ceb72fe625a02131a89bd2a911ca50e0a8a2c20a73c4bc624f5a3055e6578a6a135b3e14ff59f652ff9c05eb0ec4bdcfc3aa519e977036c8bf989dde3ca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.beta.4
1
+ 1.0.0.beta.5
@@ -1,19 +1,8 @@
1
1
  // Color Toolkit
2
2
  // =============
3
3
 
4
- $color-functions: (
5
- hue: adjust-hue,
6
- lightness: scale-lightness,
7
- saturation: scale-saturation,
8
- alpha: rgba,
9
- ) !default;
10
-
11
- $base-colors: () !default;
12
4
  $colors: () !default;
13
5
 
14
- $contrasted-dark-default: #000 !default;
15
- $contrasted-light-default: #fff !default;
16
-
17
6
 
18
7
  // Colors
19
8
  // ------
@@ -29,81 +18,18 @@ $contrasted-light-default: #fff !default;
29
18
  // -----
30
19
  // Access your color pallette
31
20
  @function color(
32
- $name
33
- ) {
34
- $_return: $name;
35
-
36
- @if color-get($name) {
37
- $_return: make-color($name);
38
- }
39
-
40
- @if type-of($_return) != color {
41
- @warn "#{$name} is not a valid color option."
42
- }
43
-
44
- @return $_return;
45
- }
46
-
47
-
48
- // Make Color
49
- // ----------
50
- // Create new colors based on existing colors
51
- @function make-color(
52
21
  $color
53
22
  ) {
54
- $_base: null;
55
- $_adjustments: ();
56
- $_return: $color;
57
-
58
- @if type-of($_return) != color {
59
- @each $arg in $color {
60
- @if type-of($arg) == map {
61
- $_adjustments: $arg;
62
- } @else {
63
- $_base: if($_base, join($_base, $arg), $arg);
64
- }
65
- }
23
+ $get: map-get($colors, $color) or $color;
24
+ $base: nth($get, 1);
25
+ $adjust: if(length($get) > 1, nth($get, 2), ());
26
+ $color: if(type-of($base) == color, $base, color($base));
66
27
 
67
- @if type-of($_base) != color {
68
- @if color-get($_base) {
69
- $_base: make-color(color-get($_base));
70
- } @else {
71
- @warn "#{$_base} is not a valid color."
72
- }
73
- }
74
-
75
- $_return: _color-adjustments($_base, $_adjustments);
76
- }
77
-
78
- @return $_return;
79
- }
80
-
81
-
82
- // Color Get
83
- // ---------
84
- @function color-get(
85
- $key
86
- ) {
87
- @return map-get($colors, $key) or map-get($base-colors, $key);
88
- }
89
-
90
-
91
- // Color Adjustments
92
- // -----------------
93
- @function _color-adjustments(
94
- $color,
95
- $adjustments
96
- ) {
97
- @each $function, $value in $adjustments {
98
- $function: map-get($color-functions, $function) or $function;
28
+ @each $function, $values in $adjust {
99
29
  @if function-exists($function) {
100
- @if $value {
101
- $color: call($function, $color, $value...);
102
- } @else {
103
- $color: call($function, $color);
104
- }
30
+ $color: call($function, $color, $values...)
105
31
  } @else {
106
- @warn "#{$function}() is not a valid function."
32
+ @warn "#{$function} is not a valid color function.";
107
33
  }
108
34
  }
109
35
 
@@ -22,45 +22,20 @@ $_ratio-options: (
22
22
  $ratio: fifth !default;
23
23
 
24
24
 
25
- // Make Size
26
- // ---------
27
- @function make-size(
28
- $size,
29
- $root: $base-font-size,
30
- $ratio: $ratio
31
- ) {
32
- $_return: false;
33
-
34
- @if type-of($ratio) == string {
35
- $ratio: map-get($_ratio-options, $ratio);
36
- }
37
-
38
- @if $ratio == linear {
39
- $_return: round($root * $size);
40
- } @else {
41
- $_return: round($root * pow($ratio, $size));
42
- }
43
-
44
- @return $_return;
45
- }
46
-
47
-
48
25
  // Sizes
49
26
  // -----
50
27
  $font-sizes: (
51
- xxxlarge: make-size(4),
52
- xxlarge: make-size(3),
53
- xlarge: make-size(2),
54
- large: make-size(1),
55
- normal: make-size(0),
56
- small: make-size(-1),
57
- xsmall: make-size(-2),
58
- xxsmall: make-size(-3),
59
- xxxsmall: make-size(-4),
28
+ h1: 4,
29
+ h2: 3,
30
+ h3: 2,
31
+ line: 1,
32
+ normal: 0,
33
+ small: -1,
34
+ smaller: -2,
60
35
  );
61
36
 
62
37
  $sizes: (
63
- base: make-size(0),
38
+ gutter: 1,
64
39
  );
65
40
 
66
41
 
@@ -82,9 +57,32 @@ $sizes: (
82
57
  }
83
58
 
84
59
 
60
+ // Make Size
61
+ // ---------
62
+ @function _make-size(
63
+ $size,
64
+ $root: $base-font-size,
65
+ $ratio: $ratio
66
+ ) {
67
+ $_return: false;
68
+
69
+ @if type-of($ratio) == string {
70
+ $ratio: map-get($_ratio-options, $ratio);
71
+ }
72
+
73
+ @if $ratio == linear {
74
+ $_return: round($root * $size);
75
+ } @else {
76
+ $_return: round($root * pow($ratio, $size));
77
+ }
78
+
79
+ @return $_return;
80
+ }
81
+
82
+
85
83
  // Get Size
86
84
  // --------
87
- @function get-size(
85
+ @function _get-size(
88
86
  $size,
89
87
  $unit: $rhythm-unit,
90
88
  $scale: $sizes
@@ -93,8 +91,12 @@ $sizes: (
93
91
  $size: map-get($scale, $size);
94
92
  }
95
93
 
94
+ @if $size and unitless($size) {
95
+ $size: _make-size($size);
96
+ }
97
+
96
98
  @if $unit == rem {
97
- $size: rem($size);
99
+ $size: _rem($size);
98
100
  }
99
101
 
100
102
  @return $size;
@@ -103,7 +105,7 @@ $sizes: (
103
105
 
104
106
  // Rem
105
107
  // ---
106
- @function rem(
108
+ @function _rem(
107
109
  $size
108
110
  ) {
109
111
  $_return: $size;
@@ -124,7 +126,7 @@ $sizes: (
124
126
  $size,
125
127
  $unit: $rhythm-unit
126
128
  ) {
127
- @return get-size($size, $unit, $sizes);
129
+ @return _get-size($size, $unit, $sizes);
128
130
  }
129
131
 
130
132
 
@@ -134,12 +136,12 @@ $sizes: (
134
136
  $size,
135
137
  $unit: $rhythm-unit
136
138
  ) {
137
- @return get-size($size, $unit, $font-sizes);
139
+ @return _get-size($size, $unit, $font-sizes);
138
140
  }
139
141
 
140
142
 
141
- // Font Size (function)
142
- // --------------------
143
+ // Font Size (mixin)
144
+ // -----------------
143
145
  @mixin font-size(
144
146
  $size: normal,
145
147
  $lines: false
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.5
4
+ version: 1.0.0.beta.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric M. Suzanne