summaryrefslogtreecommitdiffstats
path: root/browser/components/urlbar/content/quicksuggestOnboarding.css
blob: 6ed8454398c92073809c722de98528e50221bbe6 (plain)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * When making changes, follow the example of the AboutWelcome messaging surface for font sizes, line heights,
 * etc. See: https://searchfox.org/mozilla-central/source/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
 */

:root {
  --introduction-magglass-logo-height: 128px;
  --introduction-firefox-logo-height: 72px;
  --introduction-image-height: 224px;
  --main-magglass-logo-height: 64px;
  --main-firefox-logo-height: 50px;
  --x-large-margin: 40px;
  --large-margin: 24px;
  --large-margin-const: 24px;
  --small-margin: 16px;
  --small-margin-const: 16px;
  --x-small-margin-const: 8px;
  --section-vertical-padding: 32px;
  --section-horizontal-padding: 64px;
}

body.compact {
  --introduction-image-height: 183px;
  --main-magglass-logo-height: 48px;
  --main-firefox-logo-height: 32px;
  --x-large-margin: 20px;
  --large-margin: 12px;
  --small-margin: 8px;
  --section-vertical-padding: 16px;
  --section-horizontal-padding: 32px;

  /* 15px is the non-compact font-size. */
  font-size: 13px;
}

body,
section {
  width: 536px;
}

section {
  display: flex;
  align-items: stretch;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: var(--section-vertical-padding) var(--section-horizontal-padding);
  /* This is the largest approximate natural height of the main section across
     platforms and dialog variations, erring on the side of being slightly
     larger than necessary. If you change this, also update COMPACT_MODE_HEIGHT
     in the JS. */
  min-height: 650px;
}

body.compact section {
  /* This is the largest approximate natural height of the main section across
     platforms and dialog variations in compact mode, erring on the side of
     being slightly larger than necessary. */
  min-height: 510px;
}

a {
  cursor: pointer;
  font-weight: normal;
}

.title {
  font-size: 1.6em;
  font-weight: 600;
  line-height: 1.5;
  white-space: pre-line;
}

.logo {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: none;
}

.description-section {
  /* The effective visual margin between the description and first option should
     be --large-margin-const. Each child in the description has a bottom margin
     of --small-margin, so subtract it from --large-margin-const. */
  margin-block: 0 calc(var(--large-margin-const) - var(--small-margin));
}

.description {
  font-size: 1.1em;
  font-weight: 400;
  line-height: 1.6;
  margin-block: 0 var(--small-margin);
  white-space: pre-line;
}

.privacy-first {
  font-size: 1.1em;
  font-weight: 700;
  margin-block: 0 var(--small-margin);
}

.pager > span {
  display: inline-block;
  border-radius: 3px;
  width: 6px;
  height: 6px;
  background-color: var(--in-content-border-color);
  margin-inline: 4px;
}

.pager > .current {
  background-color: var(--in-content-primary-button-background);
}

#introduction-section .logo {
  background-image: url("quicksuggestOnboarding_magglass.svg");
  height: var(--introduction-magglass-logo-height);
  margin-block-end: var(--large-margin);
}

#introduction-section .logo.firefox {
  background-image: url("chrome://branding/content/about-logo.svg");
  height: var(--introduction-firefox-logo-height);
}

@media (prefers-reduced-motion: no-preference) {
  #introduction-section .logo {
    background-image: url("quicksuggestOnboarding_magglass_animation.svg");
  }
}

#introduction-section .title {
  margin-block-end: var(--x-large-margin);
}

#introduction-image {
  height: var(--introduction-image-height);
  background-image: url("suggest-example.svg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-block: var(--large-margin);
}

/* fx100 layout */
#introduction-section.layout-100 .logo {
  height: var(--main-firefox-logo-height);
}

#introduction-section.layout-100 .title {
  margin-block: 0 var(--small-margin);
}

#introduction-section:not(.layout-100) .description-section {
  display: none;
}

#onboardingClose {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  margin: 16px;
  padding: 0;
  line-height: 0;
  min-width: 20px;
  min-height: 20px;
}

#onboardingClose img {
  -moz-context-properties: fill;
  fill: currentColor;
}

#main-section:not(.active) {
  display: none;
}

#main-section .logo {
  background-image: url("quicksuggestOnboarding_magglass.svg");
  height: var(--main-magglass-logo-height);
  margin-block-end: var(--large-margin);
}

#main-section .logo.firefox {
  background-image: url("chrome://branding/content/about-logo.svg");
  height: var(--main-firefox-logo-height);
}

#main-section .title {
  margin-block: 0 var(--small-margin);
}

#main-section .privacy-first:not(.active) {
  display: none;
}

#main-section .option {
  border-radius: 4px;
  border: 2px solid var(--in-content-box-info-background);
  display: flex;
  text-align: start;
  /* Use --small-margin-const for the horizontal padding to make the option's
     horizontal padding larger than the vertical padding in compact mode. The
     radio button and text are too close to the left and right edges of the
     option's border otherwise. */
  padding: var(--small-margin) var(--small-margin-const);
  flex-direction: row;
}

#main-section .option.selected {
  border-color: var(--in-content-primary-button-background);
}

#main-section .option.accept {
  margin-block-end: var(--small-margin);
}

#main-section .option.reject {
  margin-block-end: var(--large-margin-const);
}

#main-section .option > label {
  /* Make the whole option area selectable for the radio button. 22px is the
     width of the radio button and its inline margin. */
  padding-block: var(--small-margin);
  padding-inline-start: calc(22px + var(--small-margin-const));
  padding-inline-end: var(--small-margin-const);
  margin-block: calc(-1 * var(--small-margin));
  margin-inline-start: calc(-1 * (22px + var(--small-margin-const)));
  margin-inline-end: calc(-1 * var(--small-margin-const));
}

body:not(.compact) #main-section .option > input {
  /* Vertically align the radio button with the .option-label. */
  margin-block-start: 0.25em;
}

#main-section .option-label {
  font-size: 1.1em;
  font-weight: 600;
  margin-block-end: 2px;
}

#main-section .option-description {
  font-size: 1em;
}

.buttonBox {
  display: flex;
  flex-direction: column;
  align-items: center;
}

button {
  margin-block-end: var(--large-margin);
}

#onboardingSkipLink {
  margin-block-end: var(--x-small-margin-const);
}

/* transition from introduction to main */
#introduction-section.inactive {
  /* Avoid including this section size */
  position: fixed;
  pointer-events: none;
  animation: fadeout 0.3s forwards;
}

#main-section.active {
  animation: fadein 0.3s forwards;
}

@keyframes fadeout {
  0% {
    opacity: 1;
  }
  100% {
    visibility: hidden;
    opacity: 0;
  }
}

@keyframes fadein {
  0% {
    opacity: 0;
  }
  100% {
    pointer-events: initial;
    opacity: 1;
  }
}

/* Show main only without transition */
body.skip-introduction #introduction-section.inactive {
  animation: none;
  display: none;
}

body.skip-introduction #main-section.active {
  animation: none;
  pointer-events: initial;
}

body.skip-introduction .pager {
  display: none;
}