@redocly/theme 0.32.2 → 0.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/Markdown/MarkdownWrapper.js +6 -0
- package/lib/components/Profile/LoginLink.js +6 -3
- package/lib/globalStyle.js +6 -0
- package/lib/ui/darkColors.js +26 -0
- package/package.json +1 -1
- package/src/components/Markdown/MarkdownWrapper.tsx +6 -0
- package/src/components/Profile/LoginLink.tsx +8 -4
- package/src/globalStyle.ts +6 -0
- package/src/ui/darkColors.tsx +26 -0
|
@@ -290,26 +290,32 @@ exports.MarkdownWrapper = styled_components_1.default.main.attrs(({ className })
|
|
|
290
290
|
|
|
291
291
|
h1.md code {
|
|
292
292
|
font-size: var(--h1-font-size);
|
|
293
|
+
line-height: var(--h1-code-line-height);
|
|
293
294
|
}
|
|
294
295
|
|
|
295
296
|
h2.md code {
|
|
296
297
|
font-size: var(--h2-font-size);
|
|
298
|
+
line-height: var(--h2-code-line-height);
|
|
297
299
|
}
|
|
298
300
|
|
|
299
301
|
h3.md code {
|
|
300
302
|
font-size: var(--h3-font-size);
|
|
303
|
+
line-height: var(--h3-code-line-height);
|
|
301
304
|
}
|
|
302
305
|
|
|
303
306
|
h4.md code {
|
|
304
307
|
font-size: var(--h4-font-size);
|
|
308
|
+
line-height: var(--h4-code-line-height);
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
h5.md code {
|
|
308
312
|
font-size: var(--h5-font-size);
|
|
313
|
+
line-height: var(--h5-code-line-height);
|
|
309
314
|
}
|
|
310
315
|
|
|
311
316
|
h6.md code {
|
|
312
317
|
font-size: var(--h6-font-size);
|
|
318
|
+
line-height: var(--h6-code-line-height);
|
|
313
319
|
}
|
|
314
320
|
|
|
315
321
|
code {
|
|
@@ -12,9 +12,11 @@ const telemetry_1 = require("../../mocks/telemetry");
|
|
|
12
12
|
function LoginLink({ href }) {
|
|
13
13
|
const { userProfile } = (0, useThemeConfig_1.useThemeConfig)();
|
|
14
14
|
const { translate } = (0, hooks_1.useTranslate)();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const handleLoginClick = () => {
|
|
16
|
+
telemetry_1.telemetry.send('login_button_clicked', {});
|
|
17
|
+
window.location.href = href;
|
|
18
|
+
};
|
|
19
|
+
return (react_1.default.createElement(StyledLink, { "data-translation-key": "theme.profile.login", onClick: () => handleLoginClick(), "data-cy": href }, translate('theme.profile.login', (userProfile === null || userProfile === void 0 ? void 0 : userProfile.loginLabel) || 'Login')));
|
|
18
20
|
}
|
|
19
21
|
exports.LoginLink = LoginLink;
|
|
20
22
|
const StyledLink = styled_components_1.default.a.attrs(() => ({
|
|
@@ -30,5 +32,6 @@ const StyledLink = styled_components_1.default.a.attrs(() => ({
|
|
|
30
32
|
&:hover {
|
|
31
33
|
color: var(--navbar-item-hover-text-color);
|
|
32
34
|
}
|
|
35
|
+
cursor: pointer;
|
|
33
36
|
`;
|
|
34
37
|
//# sourceMappingURL=LoginLink.js.map
|
package/lib/globalStyle.js
CHANGED
|
@@ -396,6 +396,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
396
396
|
--h1-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
397
397
|
--h1-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
398
398
|
--h1-text-color: var(--heading-text-color); // @presenter Color
|
|
399
|
+
--h1-code-line-height: 60px; // @presenter LineHeight
|
|
399
400
|
|
|
400
401
|
/**
|
|
401
402
|
* @tokens Heading level 2
|
|
@@ -408,6 +409,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
408
409
|
--h2-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
409
410
|
--h2-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
410
411
|
--h2-text-color: var(--heading-text-color); // @presenter Color
|
|
412
|
+
--h2-code-line-height: 48px; // @presenter LineHeight
|
|
411
413
|
|
|
412
414
|
/**
|
|
413
415
|
* @tokens Heading level 3
|
|
@@ -420,6 +422,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
420
422
|
--h3-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
421
423
|
--h3-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
422
424
|
--h3-text-color: var(--heading-text-color); // @presenter Color
|
|
425
|
+
--h3-code-line-height: var(--line-height-xxlg); // @presenter LineHeight
|
|
423
426
|
|
|
424
427
|
/**
|
|
425
428
|
* @tokens Heading level 4
|
|
@@ -432,6 +435,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
432
435
|
--h4-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
433
436
|
--h4-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
434
437
|
--h4-text-color: var(--heading-text-color); // @presenter Color
|
|
438
|
+
--h4-code-line-height: var(--line-height-xlg); // @presenter LineHeight
|
|
435
439
|
|
|
436
440
|
/**
|
|
437
441
|
* @tokens Heading level 5
|
|
@@ -444,6 +448,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
444
448
|
--h5-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
445
449
|
--h5-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
446
450
|
--h5-text-color: var(--heading-text-color); // @presenter Color
|
|
451
|
+
--h5-code-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
447
452
|
|
|
448
453
|
/**
|
|
449
454
|
* @tokens Heading level 6
|
|
@@ -456,6 +461,7 @@ const headingsTypography = (0, styled_components_1.css) `
|
|
|
456
461
|
--h6-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
457
462
|
--h6-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
458
463
|
--h6-text-color: var(--heading-text-color); // @presenter Color
|
|
464
|
+
--h6-code-line-height: var(--line-height-md); // @presenter LineHeight
|
|
459
465
|
|
|
460
466
|
// @tokens End
|
|
461
467
|
`;
|
package/lib/ui/darkColors.js
CHANGED
|
@@ -220,6 +220,32 @@ exports.darkMode = (0, styled_components_1.css) `
|
|
|
220
220
|
--border-primary: #ffffff21; // Raised dividers
|
|
221
221
|
--border-secondary: #ffffff17; // Default dividers, borders
|
|
222
222
|
|
|
223
|
+
/**
|
|
224
|
+
* @tokens Dark Theme Scrollbar Config
|
|
225
|
+
* @presenter Color
|
|
226
|
+
*/
|
|
227
|
+
|
|
228
|
+
*::-webkit-scrollbar {
|
|
229
|
+
width: 8px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
*::-webkit-scrollbar-track {
|
|
233
|
+
background-color: var(--bg-base);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
*::-webkit-scrollbar-thumb {
|
|
237
|
+
background-color: var(--bg-overlay);
|
|
238
|
+
border-radius: 13px;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
242
|
+
background: var(--bg-sunken);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
*::-webkit-scrollbar-corner {
|
|
246
|
+
background-color: transparent;
|
|
247
|
+
}
|
|
248
|
+
|
|
223
249
|
// @tokens End
|
|
224
250
|
`;
|
|
225
251
|
//# sourceMappingURL=darkColors.js.map
|
package/package.json
CHANGED
|
@@ -274,26 +274,32 @@ export const MarkdownWrapper = styled.main.attrs<{
|
|
|
274
274
|
|
|
275
275
|
h1.md code {
|
|
276
276
|
font-size: var(--h1-font-size);
|
|
277
|
+
line-height: var(--h1-code-line-height);
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
h2.md code {
|
|
280
281
|
font-size: var(--h2-font-size);
|
|
282
|
+
line-height: var(--h2-code-line-height);
|
|
281
283
|
}
|
|
282
284
|
|
|
283
285
|
h3.md code {
|
|
284
286
|
font-size: var(--h3-font-size);
|
|
287
|
+
line-height: var(--h3-code-line-height);
|
|
285
288
|
}
|
|
286
289
|
|
|
287
290
|
h4.md code {
|
|
288
291
|
font-size: var(--h4-font-size);
|
|
292
|
+
line-height: var(--h4-code-line-height);
|
|
289
293
|
}
|
|
290
294
|
|
|
291
295
|
h5.md code {
|
|
292
296
|
font-size: var(--h5-font-size);
|
|
297
|
+
line-height: var(--h5-code-line-height);
|
|
293
298
|
}
|
|
294
299
|
|
|
295
300
|
h6.md code {
|
|
296
301
|
font-size: var(--h6-font-size);
|
|
302
|
+
line-height: var(--h6-code-line-height);
|
|
297
303
|
}
|
|
298
304
|
|
|
299
305
|
code {
|
|
@@ -13,13 +13,16 @@ export function LoginLink({ href }: LoginLinkProps): JSX.Element {
|
|
|
13
13
|
const { userProfile } = useThemeConfig();
|
|
14
14
|
const { translate } = useTranslate();
|
|
15
15
|
|
|
16
|
+
const handleLoginClick = () => {
|
|
17
|
+
telemetry.send('login_button_clicked', {});
|
|
18
|
+
window.location.href = href;
|
|
19
|
+
};
|
|
20
|
+
|
|
16
21
|
return (
|
|
17
22
|
<StyledLink
|
|
18
|
-
href={href}
|
|
19
23
|
data-translation-key="theme.profile.login"
|
|
20
|
-
onClick={() =>
|
|
21
|
-
|
|
22
|
-
}}
|
|
24
|
+
onClick={() => handleLoginClick()}
|
|
25
|
+
data-cy={href}
|
|
23
26
|
>
|
|
24
27
|
{translate('theme.profile.login', userProfile?.loginLabel || 'Login')}
|
|
25
28
|
</StyledLink>
|
|
@@ -39,4 +42,5 @@ const StyledLink = styled.a.attrs(() => ({
|
|
|
39
42
|
&:hover {
|
|
40
43
|
color: var(--navbar-item-hover-text-color);
|
|
41
44
|
}
|
|
45
|
+
cursor: pointer;
|
|
42
46
|
`;
|
package/src/globalStyle.ts
CHANGED
|
@@ -399,6 +399,7 @@ const headingsTypography = css`
|
|
|
399
399
|
--h1-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
400
400
|
--h1-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
401
401
|
--h1-text-color: var(--heading-text-color); // @presenter Color
|
|
402
|
+
--h1-code-line-height: 60px; // @presenter LineHeight
|
|
402
403
|
|
|
403
404
|
/**
|
|
404
405
|
* @tokens Heading level 2
|
|
@@ -411,6 +412,7 @@ const headingsTypography = css`
|
|
|
411
412
|
--h2-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
412
413
|
--h2-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
413
414
|
--h2-text-color: var(--heading-text-color); // @presenter Color
|
|
415
|
+
--h2-code-line-height: 48px; // @presenter LineHeight
|
|
414
416
|
|
|
415
417
|
/**
|
|
416
418
|
* @tokens Heading level 3
|
|
@@ -423,6 +425,7 @@ const headingsTypography = css`
|
|
|
423
425
|
--h3-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
424
426
|
--h3-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
425
427
|
--h3-text-color: var(--heading-text-color); // @presenter Color
|
|
428
|
+
--h3-code-line-height: var(--line-height-xxlg); // @presenter LineHeight
|
|
426
429
|
|
|
427
430
|
/**
|
|
428
431
|
* @tokens Heading level 4
|
|
@@ -435,6 +438,7 @@ const headingsTypography = css`
|
|
|
435
438
|
--h4-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
436
439
|
--h4-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
437
440
|
--h4-text-color: var(--heading-text-color); // @presenter Color
|
|
441
|
+
--h4-code-line-height: var(--line-height-xlg); // @presenter LineHeight
|
|
438
442
|
|
|
439
443
|
/**
|
|
440
444
|
* @tokens Heading level 5
|
|
@@ -447,6 +451,7 @@ const headingsTypography = css`
|
|
|
447
451
|
--h5-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
448
452
|
--h5-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
449
453
|
--h5-text-color: var(--heading-text-color); // @presenter Color
|
|
454
|
+
--h5-code-line-height: var(--line-height-lg); // @presenter LineHeight
|
|
450
455
|
|
|
451
456
|
/**
|
|
452
457
|
* @tokens Heading level 6
|
|
@@ -459,6 +464,7 @@ const headingsTypography = css`
|
|
|
459
464
|
--h6-margin-top: var(--heading-margin-top); // @presenter Spacing
|
|
460
465
|
--h6-margin-bottom: var(--heading-margin-bottom); // @presenter Spacing
|
|
461
466
|
--h6-text-color: var(--heading-text-color); // @presenter Color
|
|
467
|
+
--h6-code-line-height: var(--line-height-md); // @presenter LineHeight
|
|
462
468
|
|
|
463
469
|
// @tokens End
|
|
464
470
|
`;
|
package/src/ui/darkColors.tsx
CHANGED
|
@@ -218,5 +218,31 @@ export const darkMode = css`
|
|
|
218
218
|
--border-primary: #ffffff21; // Raised dividers
|
|
219
219
|
--border-secondary: #ffffff17; // Default dividers, borders
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* @tokens Dark Theme Scrollbar Config
|
|
223
|
+
* @presenter Color
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
*::-webkit-scrollbar {
|
|
227
|
+
width: 8px;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
*::-webkit-scrollbar-track {
|
|
231
|
+
background-color: var(--bg-base);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
*::-webkit-scrollbar-thumb {
|
|
235
|
+
background-color: var(--bg-overlay);
|
|
236
|
+
border-radius: 13px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
*::-webkit-scrollbar-thumb:hover {
|
|
240
|
+
background: var(--bg-sunken);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
*::-webkit-scrollbar-corner {
|
|
244
|
+
background-color: transparent;
|
|
245
|
+
}
|
|
246
|
+
|
|
221
247
|
// @tokens End
|
|
222
248
|
`;
|