accoutrement 0.1.0 → 0.1.1

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: 24bd5bad1dac14124a58c4f07a65183dfa3748ea
4
- data.tar.gz: 85a3674dd24f6bfd15f63da21d9a2f39d6d3f98f
3
+ metadata.gz: 0de296f8054bdf58731898019d63f302f14dc232
4
+ data.tar.gz: 2ab5a64d67cd46de387163e198f978980c1ed91c
5
5
  SHA512:
6
- metadata.gz: 5241b7e5451f72d4abc394b3de2cfee6e911b4599bfb97b9bdc55ca4e32f85d20b60ccdde0f6298411d39831d50028a9343a4f772d39e5196633e515e6bfae15
7
- data.tar.gz: 44f990a7a31344d2f05382694a50ba046d3ec3a3ad6a1bb3360a4d82b5e0340174282d20a5c5c2aebbbe66f99ae8918ee0d4e4ac790a366e1d6888e30a3ee321
6
+ metadata.gz: 054ffe81109fae0450400b26a32262a8a95ea84532b69054a8a9dd799f62dcfb2af5bf826a91c9027428ff54fbd260489d41e6870751cca616379a0e4d482781
7
+ data.tar.gz: 525f02eafe1da32a28906b12bcfd75834d991960f174687086074b79310d9bd91f1c059dc5b66e1fb94c7296f5be8cefa9c55f45e575eaaa6dd049632dc038b7
@@ -0,0 +1,20 @@
1
+ // Utilities
2
+ // ---------
3
+
4
+ @import 'accoutrement/maps';
5
+ @import 'accoutrement/settings';
6
+ @import 'accoutrement/scale';
7
+ @import 'accoutrement/fonts';
8
+ @import 'accoutrement/color';
9
+
10
+
11
+ // Patterns
12
+ // --------
13
+
14
+ @import 'accoutrement/a11y';
15
+ @import 'accoutrement/pseudo-elements';
16
+ @import 'accoutrement/icons';
17
+ @import 'accoutrement/input-toggle';
18
+ @import 'accoutrement/arrows';
19
+ @import 'accoutrement/fluid-media';
20
+ @import 'accoutrement/tooltips';
@@ -0,0 +1,38 @@
1
+ // Accessibility
2
+ // =============
3
+
4
+
5
+ // Is Hidden
6
+ // ---------
7
+
8
+ @mixin _is-hidden--position {
9
+ position: absolute;
10
+ top: -9999px;
11
+ left: -9999px;
12
+ }
13
+
14
+ @mixin _is-hidden--clip {
15
+ position: absolute;
16
+ height: 1px;
17
+ width: 1px;
18
+ overflow: hidden;
19
+ clip: rect(1px, 1px, 1px, 1px);
20
+ }
21
+
22
+ @mixin is-hidden(
23
+ $method: clip
24
+ ) {
25
+ @if $method == position {
26
+ @include _is-hidden--position;
27
+ } @else {
28
+ @include _is-hidden--clip;
29
+ }
30
+ }
31
+
32
+
33
+ // Placeholders
34
+ // ------------
35
+
36
+ %is-hidden {
37
+ @include is-hidden;
38
+ }
@@ -0,0 +1,162 @@
1
+ // Arrows
2
+ // ======
3
+
4
+ @include set(arrows, (
5
+ position: top,
6
+ offset: center,
7
+ direction: auto,
8
+ size: 1em,
9
+ color: black,
10
+ border-width: null,
11
+ border-color: null,
12
+ ));
13
+
14
+
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
+ // Arrow Base
40
+ // ----------
41
+ @mixin _arrow-base {
42
+ content: " ";
43
+ position: absolute;
44
+ height: 0;
45
+ width: 0;
46
+ border: solid transparent;
47
+ pointer-events: none;
48
+ }
49
+
50
+ %_arrow-base {
51
+ @include _arrow-base;
52
+ }
53
+
54
+
55
+ // Parse Arrow
56
+ // -----------
57
+ @function _parse-arrow(
58
+ $arrow: null
59
+ ) {
60
+ $_return: get(arrows);
61
+ $_numbers: ();
62
+ $_strings: ();
63
+
64
+ @if type-of($arrow) == map {
65
+ $_return: map-merge($_return, $arrow);
66
+ } @else if $arrow {
67
+
68
+ @each $val in $arrow {
69
+ @if type-of($val) == map {
70
+ $_return: map-merge($_return, $val);
71
+ } @else if type-of($val) == color {
72
+ $_return: map-merge($_return, (color: $val));
73
+ } @else if type-of($val) == string {
74
+ @if index(auto up down forward backward, $val) {
75
+ $_return: map-merge($_return, (direction: $val));
76
+ } @else {
77
+ $_strings: append($_strings, $val);
78
+ }
79
+ } @else if type-of($val) == number {
80
+ $_numbers: append($_numbers, $val);
81
+ }
82
+ }
83
+
84
+ @if $_strings {
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
+ @if $_numbers {
92
+ $_return: map-merge($_return, (size: nth($_numbers, 1)));
93
+ @if length($_numbers) > 1 {
94
+ $_return: map-merge($_return, (offset: nth($_numbers, 2)));
95
+ }
96
+ }
97
+ }
98
+
99
+ @return $_return;
100
+ }
101
+
102
+
103
+ // Build Arrow
104
+ // -----------
105
+ @function _build-arrow(
106
+ $arrow
107
+ ) {
108
+ $arrow: _parse-arrow($arrow);
109
+ $_position: map-get($arrow, position);
110
+ $_offset: map-get($arrow, offset);
111
+ $_color: map-get($arrow, color);
112
+ $_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
+ }
124
+
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
+ }
148
+
149
+ @if $_border-size and $_border-color {
150
+
151
+ $_border: map-merge($_body, (
152
+ border-#{$_opposite}-color: $border-color,
153
+ margin-#{$offset-position}: if($offset == 'center', 0 - $_border, 0 - $border-size * $border-ratio),
154
+ margin-#{$_opposite}: $_border-size,
155
+ ));
156
+ }
157
+
158
+ @return (
159
+ body: $_body,
160
+ border: $_border,
161
+ );
162
+ }
@@ -0,0 +1,106 @@
1
+ // Color Toolkit
2
+ // =============
3
+
4
+ @include set(color-keywords, (
5
+ lightest: 80%,
6
+ lighter: 50%,
7
+ light: 20%,
8
+ dark: -20%,
9
+ darker: -50%,
10
+ darkest: -80%,
11
+ ));
12
+
13
+ $contrasted-dark-default : black !default;
14
+ $contrasted-light-default : white !default;
15
+
16
+
17
+ // Color
18
+ // -----
19
+ @function color(
20
+ $args,
21
+ $alpha: 1
22
+ ) {
23
+ $args: _parse-color($args);
24
+ $_color: map-get($args, color);
25
+ $_lightness: map-get($args, lightness);
26
+ $_saturation: map-get($args, saturation);
27
+
28
+ @if $_lightness {
29
+ @if $_lightness > 0 {
30
+ $_color: tint($_color, $_lightness);
31
+ } @else if $_lightness < 0 {
32
+ $_color: shade($_color, abs($_lightness));
33
+ }
34
+ }
35
+
36
+ @if $_saturation {
37
+ $_color: scale-color($_color, $saturation: $_saturation);
38
+ }
39
+
40
+ @return rgba($_color, $alpha);
41
+ }
42
+
43
+
44
+ // Contrast
45
+ // --------
46
+ @function contrast(
47
+ $color,
48
+ $contrast: $contrasted-dark-default $contrasted-light-default
49
+ ) {
50
+ $contrasted-light: false;
51
+ $contrasted-dark: false;
52
+
53
+ @if length($contrast) == 2 {
54
+ $light1: brightness(nth($contrast,1));
55
+ $light2: brightness(nth($contrast,2));
56
+ $contrasted-light: if($light1 > $light2, nth($contrast,1), nth($contrast,2));
57
+ $contrasted-dark: if($light1 < $light2, nth($contrast,1), nth($contrast,2));
58
+ } @else {
59
+ @warn "Contrast takes two colors (light & dark) for the second argument.";
60
+ }
61
+
62
+ $color-brightness: brightness($color);
63
+ $light-contrast-brightness: brightness($contrasted-light);
64
+ $dark-contrast-brightness: brightness($contrasted-dark);
65
+
66
+ $light-diff: abs($color-brightness - $light-contrast-brightness);
67
+ $dark-diff: abs($color-brightness - $dark-contrast-brightness);
68
+
69
+ @return if($light-diff > $dark-diff, $contrasted-light, $contrasted-dark);
70
+ }
71
+
72
+
73
+ // Parse Color
74
+ // -----------
75
+ @function _parse-color(
76
+ $args
77
+ ) {
78
+ $_has-color: false;
79
+ $_return: (
80
+ color: gray,
81
+ lightness: null,
82
+ saturation: null,
83
+ );
84
+
85
+ @each $arg in $args {
86
+ @if type-of($arg) == color {
87
+ $_return: map-merge($_return, (color: $arg));
88
+ $_has-color: true;
89
+ }
90
+
91
+ @else if type-of($arg) == number {
92
+ @if $_has-color or length($args) == 1 {
93
+ $_return: map-merge($_return, (lightness: $arg));
94
+ } @else {
95
+ $_return: map-merge($_return, (saturation: $arg));
96
+ }
97
+ }
98
+
99
+ @else if type-of($arg) == string {
100
+ $arg: get(color-keywords, $arg);
101
+ $_return: map-merge($_return, (lightness: $arg));
102
+ }
103
+ }
104
+
105
+ @return $_return;
106
+ }
@@ -0,0 +1,48 @@
1
+ // Fluid Media
2
+ // ===========
3
+
4
+
5
+ @include set(fluid-media, (
6
+ ratio: 16/9,
7
+ width: 100%,
8
+ children: '*',
9
+ ));
10
+
11
+
12
+ // Fluid Ratio
13
+ // -----------
14
+ @mixin fluid-ratio(
15
+ $args
16
+ ) {
17
+ $_ratio: get(fluid-media ratio);
18
+ $_width: get(fluid-media width);
19
+ $_children: get(fluid-media children);
20
+
21
+ @each $arg in $args {
22
+ @if type-of($arg) == string {
23
+ $_children: $arg;
24
+ } @else if type-of($arg) == number {
25
+ @if unitless($arg) {
26
+ $_ratio: $arg;
27
+ } @else {
28
+ $_width: $arg;
29
+ }
30
+ }
31
+ }
32
+
33
+ position: relative;
34
+ height: 0;
35
+ padding-top: (1 / $_ratio) * $_width;
36
+ width: $_width;
37
+
38
+ @if $children {
39
+ > #{$children} {
40
+ display: block;
41
+ position: absolute;
42
+ top: 0;
43
+ right: 0;
44
+ bottom: 0;
45
+ left: 0;
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,113 @@
1
+ // Fontface Tools
2
+ // ==============
3
+
4
+ @include set(fontface, formats, woff ttf);
5
+
6
+
7
+ // Fonts
8
+ // -----
9
+ // Establish fonts
10
+ @mixin fonts(
11
+ $fonts: get(fonts),
12
+ $formats: get(fontface, formats)
13
+ ) {
14
+ @include import-fonts($fonts, $formats);
15
+ @include font-placeholders($fonts);
16
+ }
17
+
18
+
19
+ // Import Fonts
20
+ // ------------
21
+ // Create font-face css
22
+ @mixin import-fonts(
23
+ $fonts: get(fonts),
24
+ $formats: get(fontface, formats)
25
+ ) {
26
+ @each $font, $info in $fonts {
27
+ $name: map-get($info, name) or $font;
28
+
29
+ @each $styles, $path in map-get($info, files) {
30
+ $styles: _parse-font-styles($styles);
31
+ $src: _build-font-src($path, $formats);
32
+
33
+ @font-face {
34
+ font-family: quote($name);
35
+ src: $src;
36
+ font-weight: map-get($styles, weight);
37
+ font-style: map-get($styles, style);
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+
44
+ // Parse Font Styles
45
+ // -----------------
46
+ // Return font weight and style based on shorthand syntax
47
+ @function _parse-font-styles(
48
+ $face
49
+ ) {
50
+ $styles: italic, oblique;
51
+ $weights: 100, 200, 300, 400, 500, 600, 700, 800, 900, bold, bolder, lighter;
52
+ $return: (
53
+ weight: normal,
54
+ style: normal,
55
+ );
56
+
57
+ @each $item in $face {
58
+ @if index($styles, $item) {
59
+ $return: map-merge($return, (style: $item));
60
+ } @else if index($weights, $item) {
61
+ $return: map-merge($return, (weight: $item));
62
+ }
63
+ }
64
+
65
+ @return $return;
66
+ }
67
+
68
+
69
+ // Build Font SRC
70
+ // --------------
71
+ // Return src attribute based on path and formats
72
+ @function _build-font-src(
73
+ $path,
74
+ $formats: get(fontface, formats)
75
+ ) {
76
+ $options: (
77
+ woff: 'woff',
78
+ ttf: 'truetype',
79
+ svg: 'svg',
80
+ );
81
+ $return: ();
82
+
83
+ @each $format in $formats {
84
+ $name: map-get($options, $format);
85
+ @if $name {
86
+ $src: font-url('#{$path}.#{$format}') format($name);
87
+ $return: append($return, $src, comma);
88
+ }
89
+ }
90
+
91
+ @return $return;
92
+ }
93
+
94
+
95
+ // Font Placeholders
96
+ // -----------------
97
+ // Create font-family placeholders
98
+ @mixin font-placeholders(
99
+ $fonts: get(fonts)
100
+ ) {
101
+ @each $font, $info in $fonts {
102
+ $name: map-get($info, name) or $font;
103
+ $type: map-get($info, type);
104
+ $stack: append($name, map-get($info, stack), comma);
105
+ $stack: append($stack, $type, comma);
106
+
107
+ @if $type == monospace {
108
+ $stack: append($stack, serif);
109
+ }
110
+
111
+ %#{$font} { font-family: $stack; }
112
+ }
113
+ }
@@ -0,0 +1,66 @@
1
+ // Icon Toolkit
2
+ // ============
3
+
4
+
5
+ // Icon
6
+ // ----
7
+ @mixin icon(
8
+ $name,
9
+ $location: before
10
+ ) {
11
+ &::#{$location} {
12
+ @extend %icon;
13
+ content: get(icons, $name);
14
+ @content;
15
+ }
16
+ }
17
+
18
+
19
+ // Icon [function]
20
+ // ---------------
21
+ @function icon(
22
+ $name
23
+ ) {
24
+ @return get(icons, $name),
25
+ }
26
+
27
+
28
+ // Data Icons
29
+ // ----------
30
+ @mixin data-icons(
31
+ $icons: get(icons)
32
+ ) {
33
+ @each $name, $value in $icons {
34
+ @if map-has-key(get(icons), $value) {
35
+ $value: get(icons, $value);
36
+ }
37
+ [data-icon='#{$name}']:before { content: $value; }
38
+ }
39
+ }
40
+
41
+
42
+ // Placeholders
43
+ // ------------
44
+
45
+ @mixin icon-placeholder(
46
+ $name: get(icon-font)
47
+ ) {
48
+ %icon {
49
+ font-family: $name;
50
+ speak: none;
51
+ font-style: normal;
52
+ font-weight: normal;
53
+ font-variant: normal;
54
+ text-transform: none;
55
+ text-decoration: none;
56
+
57
+ /* Better Font Rendering =========== */
58
+ -webkit-font-smoothing: antialiased;
59
+ -moz-osx-font-smoothing: grayscale;
60
+ }
61
+
62
+ [data-icon] {
63
+ @extend %icon;
64
+ @include before(attr(data-icon));
65
+ }
66
+ }
@@ -0,0 +1,19 @@
1
+ // Input Toggles
2
+ // =============
3
+
4
+
5
+ // Is Checked
6
+ // ----------
7
+ // Add styles when an input is checked
8
+ @mixin is-checked {
9
+ &:checked { @content; }
10
+ }
11
+
12
+
13
+ // Toggle
14
+ // ------
15
+ // Create
16
+ @mixin is-toggle {
17
+ @include is-hidden;
18
+ @include is-checked { @content; }
19
+ }
@@ -0,0 +1,100 @@
1
+ // Map Functions
2
+ // =============
3
+
4
+
5
+ // Truncate List
6
+ // -------------
7
+ // Return a list, truncated to a given length
8
+ @function _truncate-list(
9
+ $list,
10
+ $length
11
+ ) {
12
+ $_return: ();
13
+
14
+ @for $i from 1 through length($list) {
15
+ $_return: if($i <= $length, append($_return, nth($list, $i)), $_return);
16
+ }
17
+
18
+ @return $_return;
19
+ }
20
+
21
+
22
+ // Deep Get
23
+ // --------
24
+ // Return a value deep in nested maps
25
+ @function deep-get(
26
+ $map,
27
+ $keys...
28
+ ) {
29
+ $_return: $map;
30
+
31
+ @each $key in $keys {
32
+ @if type-of($_return) == map {
33
+ $_return: map-get($_return, $key);
34
+ }
35
+ }
36
+
37
+ @return $_return;
38
+ }
39
+
40
+
41
+ // Deep Set
42
+ // --------
43
+ // Set a value deep in nested maps
44
+ @function deep-set(
45
+ $map,
46
+ $keys-value...
47
+ ) {
48
+ $_value: nth($keys-value, -1);
49
+ $_keys: _truncate-list($keys-value, length($keys-value) - 1);
50
+ $_length: length($_keys);
51
+ $_return: ();
52
+
53
+ @for $i from 1 through $_length {
54
+ $_n: 0 - $i;
55
+ $_level: _truncate-list($_keys, $_length + $_n);
56
+ $_level: deep-get($map, $_level...);
57
+ $_merge: (nth($_keys, $_n): $_value);
58
+ $_return: if($_level, map-merge($_level, $_merge), $_merge);
59
+ $_value: $_return;
60
+ }
61
+
62
+ @return $_return;
63
+ }
64
+
65
+
66
+ // Deep Has-Key
67
+ // ------------
68
+ // Return true if a deep key exists
69
+ @function deep-has-key(
70
+ $map,
71
+ $keys...
72
+ ) {
73
+ $_return: null;
74
+ $_stop: false;
75
+
76
+ @each $key in $keys {
77
+ @if not $_stop {
78
+ $_return: map-has-key($map, $key);
79
+ }
80
+
81
+ @if $_return {
82
+ $map: map-get($map, $key);
83
+ } @else {
84
+ $_stop: true;
85
+ }
86
+ }
87
+
88
+ @return $_return;
89
+ }
90
+
91
+
92
+ // Output Map
93
+ // ----------
94
+ @mixin output-map(
95
+ $map
96
+ ) {
97
+ @each $prop, $val in $map {
98
+ #{$prop}: $val;
99
+ }
100
+ }
@@ -0,0 +1,44 @@
1
+ // Pseudo Elements
2
+ // ===============
3
+
4
+
5
+ // Before
6
+ // ------
7
+ @mixin before(
8
+ $content
9
+ ) {
10
+ &::before {
11
+ content: $content;
12
+ @content;
13
+ }
14
+ }
15
+
16
+
17
+ // After
18
+ // -----
19
+ @mixin after(
20
+ $content
21
+ ) {
22
+ &::after {
23
+ content: $content;
24
+ @content;
25
+ }
26
+ }
27
+
28
+
29
+ // Wrap Content
30
+ // ------------
31
+ @mixin wrap-content(
32
+ $content: "“" "”"
33
+ ) {
34
+ $_before: nth($content, 1);
35
+
36
+ &::before, &::after {
37
+ content: $_before;
38
+ @content;
39
+ }
40
+
41
+ @if length($content) > 1 {
42
+ &::after { content: nth($content, 2); }
43
+ }
44
+ }
@@ -0,0 +1,76 @@
1
+ // Scales
2
+ // ======
3
+
4
+ @import "compass/typography/vertical_rhythm";
5
+
6
+ @include set(ratio-options, (
7
+ octave : 2,
8
+ major-seventh : 15/8,
9
+ minor-seventh : 16/9,
10
+ major-sixth : 5/3,
11
+ minor-sixth : 8/5,
12
+ fifth : 3/2,
13
+ augmented-fourth : 45/32,
14
+ fourth : 4/3,
15
+ major-third : 5/4,
16
+ minor-third : 6/5,
17
+ major-second : 9/8,
18
+ minor-second : 16/15,
19
+ ));
20
+
21
+ @include set(scale, (
22
+ xxxlarge : 4,
23
+ xxlarge : 3,
24
+ xlarge : 2,
25
+ large : 1,
26
+ normal : 0,
27
+ small : -1,
28
+ xsmall : -2,
29
+ xxsmall : -3,
30
+ xxxsmall : -4,
31
+ ));
32
+
33
+ @include set(ratio, fifth);
34
+
35
+
36
+ // Size
37
+ // ----
38
+ @function size(
39
+ $multiplier: normal,
40
+ $root: $base-font-size,
41
+ $ratio: get(ratio)
42
+ ) {
43
+ @if type-of($multiplier) == string {
44
+ $multiplier: get(scale, $multiplier);
45
+ }
46
+
47
+ @if type-of($ratio) == string {
48
+ $ratio: get(ratio-options, $ratio);
49
+ }
50
+
51
+ @return round($root * pow($ratio, $multiplier));
52
+ }
53
+
54
+
55
+ // Font Size
56
+ // ---------
57
+ @mixin font-size(
58
+ $size: normal,
59
+ $lines: false
60
+ ){
61
+ $_output: _get-font-sizes($size, $lines);
62
+ @include adjust-font-size-to($_output...);
63
+ }
64
+
65
+
66
+ // Get Font Sizes
67
+ // --------------
68
+ @function _get-font-sizes(
69
+ $size: normal,
70
+ $lines: false
71
+ ) {
72
+ $_return: if($lines, (lines: $lines), ());
73
+ $size: size($size);
74
+
75
+ @return map-merge($_return, (to_size: $size));
76
+ }
@@ -0,0 +1,23 @@
1
+ // Settings
2
+ // ========
3
+
4
+
5
+ $settings: ();
6
+
7
+
8
+ // Set
9
+ // ---
10
+ @mixin set(
11
+ $keys-value...
12
+ ) {
13
+ $settings: deep-set($settings, $keys-value...) !global;
14
+ }
15
+
16
+
17
+ // Get
18
+ // ---
19
+ @function get(
20
+ $keys...
21
+ ) {
22
+ @return deep-get($settings, $keys...);
23
+ }
@@ -0,0 +1,95 @@
1
+ // Tooltips
2
+ // ========
3
+
4
+ @include set(tooltips, (
5
+ position: top right,
6
+ container: '.tooltip',
7
+ content: '.tooltip-text',
8
+ ));
9
+
10
+
11
+ // Tooltip
12
+ // -------
13
+ @mixin tooltip(
14
+ $pos: get(tooltips, position)
15
+ ) {
16
+ $x: null;
17
+ $y: null;
18
+
19
+ @each $side in $pos {
20
+ $x: if($side == left or $side == right, $side, $x);
21
+ $y: if($side == top or $side == bottom, $side, $y);
22
+ }
23
+
24
+ #{get(tooltips, content)} {
25
+ @extend #{'%tooltip' + if($y, '-#{$y}', '') + if($x, '-#{$x}', '')};
26
+ @content;
27
+ }
28
+ }
29
+
30
+
31
+ // Tooltips
32
+ // --------
33
+ @mixin tooltips {
34
+ #{get(tooltips, container)} {
35
+ display: inline-block;
36
+ position: relative;
37
+ text-decoration: none;
38
+ &:hover #{get(tooltips, content)} {
39
+ display: block;
40
+ z-index: 900;
41
+ }
42
+ }
43
+
44
+ #{get(tooltips, content)} {
45
+ display: none;
46
+ position: absolute;
47
+ white-space: nowrap;
48
+ pointer-events: none;
49
+ @content;
50
+
51
+ &[data-tooltip] { @include before(attr(data-tooltip)); }
52
+ }
53
+ }
54
+
55
+
56
+ // Placeholders
57
+ // ------------
58
+
59
+ %tooltip-top {
60
+ bottom: 100%;
61
+ }
62
+
63
+ %tooltip-top-left {
64
+ @extend %tooltip-top;
65
+ right: 0;
66
+ }
67
+
68
+ %tooltip-top-right {
69
+ @extend %tooltip-top;
70
+ left: 0;
71
+ }
72
+
73
+ %tooltip-bottom {
74
+ top: 100%;
75
+ }
76
+
77
+ %tooltip-bottom-left {
78
+ @extend %tooltip-bottom;
79
+ right: 0;
80
+ }
81
+
82
+ %tooltip-bottom-right {
83
+ @extend %tooltip-bottom;
84
+ left: 0;
85
+ }
86
+
87
+ %tooltip-right {
88
+ top: 0;
89
+ left: 100%;
90
+ }
91
+
92
+ %tooltip-left {
93
+ top: 0;
94
+ right: 100%;
95
+ }
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.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Meyer
@@ -49,6 +49,19 @@ extra_rdoc_files:
49
49
  files:
50
50
  - lib/accoutrement.rb
51
51
  - lib/compass-accoutrement.rb
52
+ - stylesheets/_accoutrement.scss
53
+ - stylesheets/accoutrement/_a11y.scss
54
+ - stylesheets/accoutrement/_arrows.scss
55
+ - stylesheets/accoutrement/_color.scss
56
+ - stylesheets/accoutrement/_fluid-media.scss
57
+ - stylesheets/accoutrement/_fonts.scss
58
+ - stylesheets/accoutrement/_icons.scss
59
+ - stylesheets/accoutrement/_input-toggle.scss
60
+ - stylesheets/accoutrement/_maps.scss
61
+ - stylesheets/accoutrement/_pseudo-elements.scss
62
+ - stylesheets/accoutrement/_scale.scss
63
+ - stylesheets/accoutrement/_settings.scss
64
+ - stylesheets/accoutrement/_tooltips.scss
52
65
  - README.md
53
66
  - VERSION
54
67
  homepage: http://github.com/ericam/accoutrement/