accoutrement 0.1.4 → 0.1.5

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: c58f280d0439f22a512a7d4add29e0db4b79332a
4
- data.tar.gz: 48c456f79da1d78b16eeb8ba7386ddfd7db27d40
3
+ metadata.gz: 515657a22a3677a305a1a6a17da217a922b0c5c9
4
+ data.tar.gz: 2bc5de8afc236300aee126c8a5ff84b5f52ee098
5
5
  SHA512:
6
- metadata.gz: 33acba32335fd078d26193bf2fb4be950e2e79303eb9e2509907f334428d90a456e4b1db9568fd7fc0ad622f555d532737af651210f28aba00d636b17d1fe05b
7
- data.tar.gz: efc9b309c97108cc2ebef32236a83d6d42412aa477436a15d8d364054e70e4d72027ee2c14d266bccaa8188a2143ff8954cc8dc281c909dfabfef41ed8c69467
6
+ metadata.gz: 7950ffc5d8cf37da02621a16871729f6b150e6c4d6d607728823e78869a83aea2b14a5a52e82338c3cc13c9c35457188da5ca9c07f6bde29684ef67554755d1f
7
+ data.tar.gz: b1e1f3607d230c7f533f925ef4926ab8cf20a203469ee81e25f24d7e3035014ecc8a329f4b0a7756cfa58fb9d2986cbff4fb741453ff75c9ed45ce227a297d1e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -2,40 +2,13 @@
2
2
  // ======
3
3
 
4
4
  @include set(arrows, (
5
- position: top,
6
- offset: center,
7
- direction: auto,
5
+ direction: down,
8
6
  size: 1em,
7
+ spread: auto,
9
8
  color: black,
10
- border-width: null,
11
- border-color: null,
12
9
  ));
13
10
 
14
11
 
15
- // Arrow
16
- // -----
17
- @mixin arrow(
18
- $arrow: get(arrows),
19
- $root: relative
20
- ) {
21
- $arrow: _build-arrow($arrow);
22
- $_body: map-get($arrow, body);
23
- $_border: map-get($arrow, border);
24
-
25
- position: $root;
26
-
27
- &::after {
28
- @extend %_arrow-base;
29
- @include output-map($_body);
30
- }
31
-
32
- &::before {
33
- @if $_border { @extend %_arrow-base; }
34
- @include output-map($_border);
35
- }
36
- }
37
-
38
-
39
12
  // Arrow Base
40
13
  // ----------
41
14
  @mixin _arrow-base {
@@ -52,6 +25,30 @@
52
25
  }
53
26
 
54
27
 
28
+ // Arrow
29
+ // -----
30
+ @mixin arrow(
31
+ $arrow: get(arrows),
32
+ $place: before,
33
+ $extend: true,
34
+ $root: relative
35
+ ) {
36
+ $arrow: _build-arrow($arrow);
37
+
38
+ position: $root;
39
+
40
+ &#{'::' + $place} {
41
+ @if $extend {
42
+ @extend %_arrow-base;
43
+ } @else {
44
+ @include _arrow-base;
45
+ }
46
+ @include output-map($arrow);
47
+ @content;
48
+ }
49
+ }
50
+
51
+
55
52
  // Parse Arrow
56
53
  // -----------
57
54
  @function _parse-arrow(
@@ -59,7 +56,6 @@
59
56
  ) {
60
57
  $_return: get(arrows);
61
58
  $_numbers: ();
62
- $_strings: ();
63
59
 
64
60
  @if type-of($arrow) == map {
65
61
  $_return: map-merge($_return, $arrow);
@@ -71,27 +67,20 @@
71
67
  } @else if type-of($val) == color {
72
68
  $_return: map-merge($_return, (color: $val));
73
69
  } @else if type-of($val) == string {
74
- @if index(auto up down forward backward, $val) {
70
+ @if index(up down left right, $val) {
75
71
  $_return: map-merge($_return, (direction: $val));
76
- } @else {
77
- $_strings: append($_strings, $val);
72
+ } @else if $val == auto {
73
+ $_return: map-merge($_return, (spread: $val));
78
74
  }
79
75
  } @else if type-of($val) == number {
80
76
  $_numbers: append($_numbers, $val);
81
77
  }
82
78
  }
83
79
 
84
- @if length($_strings) > 0 {
85
- $_return: map-merge($_return, (position: nth($_strings, 1)));
86
- @if length($_strings) > 1 {
87
- $_return: map-merge($_return, (offset: nth($_strings, 2)));
88
- }
89
- }
90
-
91
80
  @if length($_numbers) > 0 {
92
81
  $_return: map-merge($_return, (size: nth($_numbers, 1)));
93
82
  @if length($_numbers) > 1 {
94
- $_return: map-merge($_return, (offset: nth($_numbers, 2)));
83
+ $_return: map-merge($_return, (spread: nth($_numbers, 2)));
95
84
  }
96
85
  }
97
86
  }
@@ -106,57 +95,23 @@
106
95
  $arrow
107
96
  ) {
108
97
  $arrow: _parse-arrow($arrow);
109
- $_position: map-get($arrow, position);
110
- $_offset: map-get($arrow, offset);
111
98
  $_color: map-get($arrow, color);
112
99
  $_size: map-get($arrow, size);
113
- $_border-color: map-get($arrow, border-color);
114
- $_border-size: map-get($arrow, border-width);
115
- $_opposite: opposite-position($_position);
116
-
117
- $_offset-position: if($_position == left or $_position == right, top, left);
118
-
119
- @if $_offset == 'bottom' or $_offset == 'right' {
120
- $_offset-position: opposite-position($_offset-position);
121
- } @else if type-of($_offset) == "number" and $_offset != abs($_offset) {
122
- $_offset-position: opposite-position($_offset-position);
123
- }
100
+ $_spread: map-get($arrow, spread);
101
+ $_direction: map-get($arrow, direction);
102
+ $_direction: if($_direction == up, top, if($_direction == down, bottom, $_direction));
103
+ $_opposite: opposite-position($_direction);
124
104
 
125
- $_border: null;
126
- $_body: (
127
- #{$_opposite}: 100%,
128
- border-#{$_opposite}-color: $_color,
129
- border-width: $_size,
130
- );
131
-
132
- @if $_offset {
133
- @if $_offset == 'center' {
134
- $_body: map-merge($_body, (
135
- #{$_offset-position}: 50%,
136
- margin-#{$_offset-position}: - $_size,
137
- ));
138
- } @else if type-of($_offset) == 'string' {
139
- $_body: map-merge($_body, (
140
- #{$_offset-position}: 0,
141
- ));
142
- } @else {
143
- $_body: map-merge($_body, (
144
- #{$_offset-position}: abs($_offset),
145
- ));
146
- }
147
- }
105
+ $_return: (border-#{$_opposite}: $_size solid $_color);
148
106
 
149
- @if $_border-size and $_border-color {
107
+ $_h: left right;
108
+ $_v: top bottom;
109
+ $_sides: if(index($_h, $_direction), $_v, $_h);
110
+ $_spread: if($_spread == auto, $_size, $_spread / 2);
150
111
 
151
- $_border: map-merge($_body, (
152
- border-#{$_opposite}-color: $_border-color,
153
- margin-#{$_offset-position}: if($_offset == center, 0 - $_size, null),
154
- margin-#{$_opposite}: $_border-size,
155
- ));
112
+ @each $_side in $_sides {
113
+ $_return: map-merge($_return, (border-#{$_side}-width: $_spread));
156
114
  }
157
115
 
158
- @return (
159
- body: $_body,
160
- border: $_border,
161
- );
116
+ @return $_return;
162
117
  }
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: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Meyer