-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path_type-helper.scss
52 lines (47 loc) · 1.89 KB
/
_type-helper.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
// =================================================================================
// SETS FONT-SIZE (1 parameter)
// Converts PX to EM (base font size: 16px)
// ---------------------------------------------------------------------------------
// $size: input for font size from Photoshop (make sure PSD settings are set to PX)
// =================================================================================
@mixin size-only ($size) {
$size: $size/16;
font-size: #{$size}em;
}
// =================================================================================
// SETS FONT-SIZE AND FONT-FAMILY (2 parameters)
// Converts PX to EM (base font size: 16px)
// ---------------------------------------------------------------------------------
// $font: font-family setting (recommended to store in its own var)
// $size: input for font size from Photoshop (make sure PSD settings are set to PX)
// =================================================================================
@mixin font-and-size ($font, $size) {
$size: $size/16;
font-family: $font;
font-size: #{$size}em;
}
// =================================================================================
// SETS LINE-HEIGHT
// ---------------------------------------------------------------------------------
// $font: font-family setting (recommended to store in its own var)
// $size: input for font size from Photoshop (make sure PSD settings are set to PX)
// =================================================================================
@mixin text-spacing ($size, $leading) {
$size: $leading/$size;
line-height: #{$size}em;
}
@mixin set-all-properties ($baseline, $size, $spacing, $font) {
font-family: $font;
@if $baseline == 1 {
line-height: 120%;
} @else {
$height: $baseline/$size;
line-height: #{$height}em;
}
@if $spacing == normal {
letter-spacing: normal;
} @else {
$spacing: $spacing/1000;
letter-spacing: #{$spacing}em;
}
}