-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path_ouif.theme.typography.scss
60 lines (47 loc) · 1.62 KB
/
_ouif.theme.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
59
60
@mixin uiUseRem($rem) {
$useRem: $rem !global;
}
@function pxToEm($size) {
@return ($size / $fontSizeCore) * 1em;
}
@function pxToRem($size) {
@return ($size / $fontSizeRoot) * 1rem;
}
// Get font size and according font weight
@mixin uiFont($fabric-font) {
@each $fontDef in $fontSizes {
// check Office UI Frabric name
$fdTitle: nth($fontDef, 1); // base office ui fabric in PX value
$fdSizePx: nth($fontDef, 2); // base office ui fabric in EM value
$fdSizeEm: if($useRem, pxToRem($fdSizePx), pxToEm($fdSizePx)); // get font weight
$fdWeight: nth($fontDef, 3);
@if $fdTitle==$fabric-font {
font-size: $fdSizeEm;
font-weight: call($fdWeight);
}
}
}
// Get font weight
@mixin uiFontWeight($fabric-font) {
@each $fontDef in $fontWeights {
$fdTitle: nth($fontDef, 1); // get font weight
$fdWeight: nth($fontDef, 2); //
$fdValue: $fdWeight; // @warn $fdTitle $fabric-font $fdTitle == nth($fabric-font, 1);
@if $fdTitle==nth($fabric-font, 1) {
font-weight: call($fdValue);
}
}
}
// Converts the font size out In EM
@mixin uiFontSize($fabric-font) {
@each $fontDef in $fontSizes {
// check Office UI Frabric name
$fdTitle: nth($fontDef, 1); // base office ui fabric in PX value
$fdSizePx: nth($fontDef, 2); // base office ui fabric in EM value
$fdSizeEm: if($useRem, pxToRem($fdSizePx), pxToEm($fdSizePx)); // get font weight
$fdWeight: nth($fontDef, 3);
@if $fdTitle==$fabric-font {
font-size: $fdSizeEm;
}
}
}