-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path_tools.mixins.scss
77 lines (64 loc) · 1.95 KB
/
_tools.mixins.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
///*------------------------------------*\
// #MIXINS
//\*------------------------------------*/
// inuitcss has a number of default mixins that the framework, and developers
// working with it, can make use of.
// Create a fully formed type style (sizing and vertical rhythm) by passing in a
// single value, e.g.:
//
// .foo {
// @include inuit-font-size(12px);
// }
//
// This will generate a rem-based font-size with its pixel fallback, as well as
// a unitless line-height which will place the element on your baseline, e.g.:
//
// .foo {
// font-size: 12px;
// font-size: 0.75rem;
// line-height: 2;
// }
//
// If you do not want inuitcss to generate you a line-height automatically, you
// simply pass in your own as a second paramater:
//
// .foo {
// @include inuit-font-size(12px, 1.5);
// }
//
// This will yield:
//
// .foo {
// font-size: 12px;
// font-size: 0.75rem;
// line-height: 1.5;
// }
//
// This parameter can be any integer, ‘inherit’, or ‘normal’. If you don’t want
// a line-height at all, pass in a second paramater of ‘none’ or ‘false’:
//
// .foo {
// @include inuit-font-size(12px, none);
// }
//
// This will yield:
//
// .foo {
// font-size: 12px;
// font-size: 0.75rem;
// }
@mixin inuit-font-size($inuit-font-size, $inuit-line-height: auto) {
font-size: $inuit-font-size;
font-size: ($inuit-font-size / $inuit-base-font-size) * 1rem;
@if $inuit-line-height == auto {
line-height: ceil($inuit-font-size / $inuit-base-line-height) * ($inuit-base-line-height / $inuit-font-size);
}
@else {
@if (type-of($inuit-line-height) == number or $inuit-line-height == inherit or $inuit-line-height == normal) {
line-height: $inuit-line-height;
}
@elseif ($inuit-line-height != none and $inuit-line-height != false) {
@warn "D’oh! ‘#{$inuit-line-height}’ is not a valid value for `line-height`."
}
}
}