-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_tools.ms.scss
More file actions
56 lines (34 loc) · 811 Bytes
/
_tools.ms.scss
File metadata and controls
56 lines (34 loc) · 811 Bytes
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
// Modular Scale Tool
// Options
$iota-tools-ms-ratio : 1.2 !default;
$iota-tools-ms-base : 15px !default;
$iota-tools-ms-scale : 3 !default;
// Helper functions
@function _iota-decimal-round(
$number,
$digits: $iota-tools-ms-scale
) {
$num: 1;
@for $i from 1 through $digits {
$num: $num * 10;
}
@return round( $number * $num ) / $num;
}
@function iota-ms(
$increment,
$base : $iota-tools-ms-base,
$ratio : $iota-tools-ms-ratio,
$scale : $iota-tools-ms-scale
) {
@if $increment > 0 {
@for $i from 1 through $increment {
$base: $base * $iota-tools-ms-ratio;
}
}
@if $increment < 0 {
@for $i from -1 through $increment {
$base: $base / $iota-tools-ms-ratio;
}
}
@return _iota-decimal-round($base, $scale);
}