-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypography.scss
60 lines (49 loc) · 1.16 KB
/
typography.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
/* Fonts Register */
$fonts : (
);
$typesets : (
);
$default: (
'font-size-px': 16,
'line-height': 1.4
);
/* Text Style Helpers */
@mixin heading {}
@mixin paragraph {}
@mixin caption {}
@mixin date {}
@mixin author {}
/* Typography Helpers Methods */
@function em($pixels, $context: map-get($default,'font-size-px')) {
@return #{$pixels/$context}em;
}
@mixin get-font-weight($font, $type) {
@each $name,$typeset in $typesets {
@if $name == $font {
font-weight: map-get($typeset, $type);
}
}
}
@mixin font-reset ($font-size, $line-height) {
$font-size : $font-size + 'px';
font-size: $font-size;
line-height: $line-height;
}
@mixin font($name: 'inherit', $type : 'regular', $size : 'null', $line-height : 'null') {
@if $name != 'inherit' {
font-family : map-get($fonts, $name);
@include get-font-weight($name, $type);
}@else {
font-family : inherit;
font-weight: $type;
}
@if $size != 'null' { font-size: $size; }
@if $line-height != 'null' { line-height: $line-height; }
}
/* Reset Default Typeset. */
body {
@include font-reset(
map-get($default, 'font-size-px'),
map-get($default, 'line-height')
);
}