-
Notifications
You must be signed in to change notification settings - Fork 165
/
_settings_spacing.scss
172 lines (153 loc) · 4.73 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
161
162
163
164
165
166
167
168
169
170
171
172
// Options
$pad-lists: true !default; // Adds padding to list items
// Typographic scale settings
$ms-ratio: 16 / 14 !default;
$sp-unit-ratio: 0.5 !default;
// Baseline grid settings
$sp-unit: 1rem * $sp-unit-ratio !default;
$font-sizes: (
small: pow($ms-ratio, -1),
root: 1,
h4-mobile: 1.22176,
h4: pow($ms-ratio, 2),
h3-mobile: pow($ms-ratio, 3),
h3: pow($ms-ratio, 4),
h2-mobile: 1.83274,
h2: pow($ms-ratio, 6),
h1-mobile: pow($ms-ratio, 6),
h1: pow($ms-ratio, 8)
);
$line-heights: (
h1: 7 * $sp-unit,
h2: 6 * $sp-unit,
h3: 5 * $sp-unit,
h4: 4 * $sp-unit,
h1-mobile: 6 * $sp-unit,
h2-mobile: 5 * $sp-unit,
h3-mobile: 4 * $sp-unit,
h4-mobile: 3 * $sp-unit,
default-text: 3 * $sp-unit,
small: $sp-unit * 2
) !default;
// baseline nudges for type scale ratio of (16/14)^2
$nudges: (
nudge--h1-large: 0.15rem,
nudge--h4-large: 0,
nudge--h1: 0.2rem,
nudge--h2: 0.2rem,
nudge--h3: 0.1rem,
nudge--h4: 0.05rem,
nudge--h6: 0.338rem,
nudge--h6-large: 0.345rem,
nudge--h1-mobile: 0.165rem,
nudge--h2-mobile: 0.1rem,
nudge--h3-mobile: 0.5rem,
nudge--h4-mobile: 0.3rem,
nudge--p: 0.4rem,
nudge--p-ubuntumono: 0.45rem,
nudge--small: 0.2rem
) !default;
// Correct baseline drift due to browser rounding. (Visible in text > 1000 lines)
// It is applied only to padding-top.
$browser-rounding-compensations: (
small: 0.0005rem,
small-largescreen: 0.0006rem,
p: 0.0005rem,
h6: 0,
h5: 0.001rem,
h4: 0.001rem,
h3: 0.001rem,
h2: 0.001rem,
h1: 0.001rem
) !default;
//scaling factor
$multi: 2 !default;
////////////////////////////////////////////////////////
// Variables connecting spacings that should be identical
// top: nudge; bottom: unit - nudge; result: height = exact multiple of base unit
$spv-nudge: map-get($nudges, nudge--p) !default;
$spv-nudge-compensation: $sp-unit - $spv-nudge !default;
// 1. VERTICAL SPACING
// 1.1 Vertical spacing inside components
$spv-inner--x-small: $sp-unit * 0.5 !default; // buttons margins inside table,
$spv-inner--x-small--scaleable: $spv-inner--x-small * $multi !default;
$spv-inner--small: $sp-unit !default;
$spv-inner--scaleable: $sp-unit * $multi !default;
$spv-inner--medium: $sp-unit * 1.5 !default; //vertical padding in: navigation, tabs
$spv-inner--large: $sp-unit * 2;
$spv-inner--x-large: $sp-unit * 5.5;
// 1.2 Vertical spacing between components
$spv-outer--small: $sp-unit * 1 !default; //labels
$spv-outer--small-scaleable: $sp-unit * $multi !default;
$spv-outer--medium: $sp-unit * 2 !default;
$spv-outer--scaleable: $sp-unit * (1 + $multi) !default;
// 1.3 Vertical spacing between a group of components and its wrapper - strips, views, entire page
$spv-outer--shallow-scaleable: $sp-unit * 2 * $multi !default;
$spv-outer--regular-scaleable: $sp-unit * 2 * (2 + $multi) !default;
$spv-outer--deep-scaleable: $sp-unit * 2 * (4 + $multi) !default;
// 2. HORIZONTAL SPACING
// 2.1 Horizontal spacing inside components
$sph-inner--small: $sp-unit !default; // input-elements,
$sph-inner: $sp-unit * 2 !default; // buttons, accordions, tabs, menu, card padding, stepped-list bullet offset
$sph-inner--large: $sp-unit * 3 !default;
$sph-inner--x-large: $sp-unit * 5 !default;
// 2.2 Horizontal spacing outside components
$sph-outer: $sph-inner !default;
$sph-outer--large: $sp-unit * 3 !default; // checboxes, radios, list bullets
$sp-before: (
h1: $sp-unit * 3,
h2: $sp-unit * 3,
h3: $sp-unit * 3,
h4: $sp-unit * 3,
p: $sp-unit * 3,
h1-mobile: $sp-unit * 3,
h2-mobile: $sp-unit * 3,
h3-mobile: $sp-unit * 3,
h4-mobile: $sp-unit * 3,
muted: $sp-unit * 3
) !default;
$spv-p-after-heading-adjustment: #{$sp-unit * -1};
// space after element on desktop
$sp-after: (
h1: $sp-unit * 3,
h2: $sp-unit * 3,
h3: $sp-unit * 3,
h4: $sp-unit * 2,
p: $sp-unit * 3,
h1-mobile: $sp-unit * 2,
h2-mobile: $sp-unit * 2,
h3-mobile: $sp-unit * 2,
h4-mobile: $sp-unit * 2,
small: $sp-unit * 2,
small--dense: $sp-unit * 2,
default-text: $sp-unit
) !default;
$max-widths: (
long: 60em,
default: 40em,
heading--long: 30em,
heading--short: 20em
) !default;
$icon-sizes: (
accordion: $sp-unit * 1.5,
default: $sp-unit * 2,
heading-icon--small: $sp-unit * 4,
heading-icon--x-small: $sp-unit * 3,
heading-icon: $sp-unit * 5,
social: $sp-unit * 4,
thumb--card: $sp-unit * 4,
thumb--large: $sp-unit * 12,
thumb--small: $sp-unit * 6,
thumb: $sp-unit * 6
) !default;
// 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;