-
Notifications
You must be signed in to change notification settings - Fork 171
/
Copy path_settings_spacing.scss
160 lines (142 loc) · 4.2 KB
/
_settings_spacing.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@use 'sass:math';
// Typographic scale settings
$ms-ratio: math.div(16, 14) !default;
$sp-unit-ratio: 0.5 !default;
// Baseline grid settings
$sp-unit: 1rem * $sp-unit-ratio !default;
$font-sizes: (
display: 5,
display-mobile: 4,
h1: 2.5,
h1-mobile: 2,
h2: 2.5,
h2-mobile: 2,
h3: 1.5,
h3-mobile: 1.5,
h4: 1.5,
h4-mobile: 1.5,
default: 1,
small: 0.875,
x-small: 0.75,
) !default;
$line-heights: (
display: 11 * $sp-unit,
display-mobile: 9 * $sp-unit,
h1: 6 * $sp-unit,
h1-mobile: 5 * $sp-unit,
h2: 6 * $sp-unit,
h2-mobile: 5 * $sp-unit,
h3: 4 * $sp-unit,
h3-mobile: 4 * $sp-unit,
h4: 4 * $sp-unit,
h4-mobile: 4 * $sp-unit,
default-text: 3 * $sp-unit,
small: 2.5 * $sp-unit,
x-small: 2 * $sp-unit,
) !default;
// baseline nudges for type scale ratio of (16/14)^2
$nudges: (
display: 0.35rem,
display-mobile: 0.25rem,
h1-large: 0.55rem,
h1-mobile: 0.55rem,
h1: 0.55rem,
h2: 0.55rem,
h2-mobile: 0.55rem,
h3: 0.45rem,
h3-mobile: 0.45rem,
h4-large: 0.45rem,
h4: 0.45rem,
h4-mobile: 0.45rem,
h5: 0.375rem,
h6: 0.375em,
h6-large: 0.375rem,
p: 0.375rem,
p-ubuntumono: 0.45rem,
small: 0.05rem,
x-small: 0.25rem,
) !default;
// Correct baseline drift due to browser rounding. (Visible in text > 1000 lines)
// It is applied only to padding-top.
// DEPRECATED, will be removed in 4.0
$browser-rounding-compensations: (
h1: 0,
h2: 0,
h3: 0,
h4: 0,
h5: 0,
h6: 0,
p: 0,
small-largescreen: 0,
small: 0,
) !default;
// Main spacing variables. spv stands spacing-vertical; sph stands for spacing-horizontal.
$spv--x-small: $sp-unit * 0.5 !default;
$spv--small: $sp-unit !default;
$spv--medium: $sp-unit * 1.5 !default;
$spv--large: $sp-unit * 2;
$spv--x-large: $sp-unit * 3 !default;
$spv--strip-shallow: $sp-unit * 3 !default;
$spv--strip-regular: $sp-unit * 8 !default;
$spv--strip-deep: $sp-unit * 16 !default;
$sph--x-small: $sp-unit * 0.5 !default; // to be used in place of an inline space between characters/words
$sph--small: $sp-unit !default;
$sph--large: $sp-unit * 2 !default;
$sph--x-large: $sp-unit * 3 !default;
// Space after text elements
$sp-after: (
display: $spv--x-large,
display-mobile: $spv--x-large,
h1: $spv--x-large,
h1-mobile: $spv--x-large,
h2: $spv--x-large,
h2-mobile: $spv--x-large,
h3: $spv--x-large,
h3-mobile: $spv--x-large,
h4: $spv--x-large,
h4-mobile: $spv--x-large,
p: $spv--x-large,
p-small-caps: $spv--large,
p-dense: $spv--large,
default-text: $sp-unit,
small: $spv--large,
small--dense: $spv--large,
x-small: $spv--large,
) !default;
// commonly occuring calculations available as variables
$spv-nudge: map-get($nudges, p) !default; // top: nudge; bottom: unit - nudge; result: height = exact multiple of base unit
$spv-nudge-compensation: $sp-unit - $spv-nudge !default;
// form input spacing variables
$input-margin-bottom: $sp-unit * 4 - $spv-nudge * 2;
$input-border-thickness: 1.5px;
$input-vertical-padding: calc($spv-nudge - $input-border-thickness);
// tick element variables
$form-tick-box-size: 1rem;
$form-tick-height: 0.375rem;
$form-tick-offset-top: 0.1875rem;
$form-tick-box-nudge: 0.15rem; // to nudge the tick box a bit below baseline (to correctly align with default text size)
$form-radio-inner-circle-diameter: 0.375rem;
$form-radio-circle-offset: 0.5 * ($form-tick-box-size - $form-radio-inner-circle-diameter);
$text-max-width: 40em !default;
$icon-sizes: (
small: $sp-unit * 1.5,
default: $sp-unit * 2,
heading-icon--x-small: $sp-unit * 3,
heading-icon--small: $sp-unit * 4,
heading-icon: $sp-unit * 5,
thumb: $sp-unit * 6,
thumb--large: $sp-unit * 12,
) !default;
$default-icon-size: map-get($icon-sizes, default);
$table-cell-vertical-padding: $spv--small;
// generic units
$sp-xx-small: $sp-unit * 0.25 !default;
$sp-x-small: $sp-unit * 0.5 !default;
$sp-small: $sp-unit !default;
$sp-medium: $sp-unit * 2 !default;
$sp-large: $sp-unit * 3 !default;
$sp-x-large: $sp-unit * 4 !default;
$sp-xx-large: $sp-unit * 5 !default;
$sp-xxx-large: $sp-unit * 6 !default;
$sp-xxxx-large: $sp-unit * 8 !default;
$sp-xxxxx-large: $sp-unit * 12 !default; // anythng this large should be expressed as a sum of constituent heights. This is not currently used AFAIK , consider removing for 3.0