@redocly/theme 0.3.0 → 0.4.2
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/Button/Button.js +3 -3
- package/CodeBlock/CodeBlock.js +1 -1
- package/ColorModeSwitcher/ColorModeSwitcher.js +1 -1
- package/Footer/Footer.js +1 -1
- package/Footer/FooterColumn.js +4 -4
- package/Footer/FooterColumns.js +1 -1
- package/Footer/FooterCopyright.js +1 -1
- package/JsonViewer/JsonViewer.js +1 -1
- package/LastUpdated/LastUpdated.d.ts +5 -0
- package/LastUpdated/LastUpdated.js +28 -0
- package/Markdown/Admonition.js +3 -3
- package/Markdown/CodeSample/CodeSample.js +3 -3
- package/Markdown/ContainerWrapper.d.ts +5 -0
- package/Markdown/ContainerWrapper.js +21 -0
- package/Markdown/MarkdownLayout.js +2 -2
- package/Markdown/MarkdownWrapper.js +3 -3
- package/Markdown/index.d.ts +1 -1
- package/Markdown/index.js +1 -1
- package/Navbar/MobileNavbarItem.js +1 -1
- package/Navbar/MobileNavbarMenu.js +6 -6
- package/Navbar/Navbar.d.ts +1 -0
- package/Navbar/Navbar.js +10 -8
- package/Navbar/NavbarDropdown.js +1 -1
- package/Navbar/NavbarItem.d.ts +3 -3
- package/Navbar/NavbarItem.js +17 -14
- package/Navbar/NavbarMenu.js +1 -1
- package/NavbarLogo/NavbarLogo.js +1 -1
- package/OperationBadge/OperationBadge.js +1 -1
- package/Panel/Panel.d.ts +2 -1
- package/Panel/Panel.js +8 -3
- package/Panel/PanelBody.js +1 -1
- package/Panel/PanelComponent.d.ts +4 -2
- package/Panel/PanelComponent.js +6 -5
- package/Panel/PanelHeader.d.ts +1 -1
- package/Panel/PanelHeader.js +3 -3
- package/Panel/PanelHeaderTitle.js +1 -1
- package/Panel/index.d.ts +0 -3
- package/Panel/index.js +0 -3
- package/Profile/Profile.js +1 -1
- package/SamplesPanelControls/SamplesPanelControls.js +6 -4
- package/Search/Autocomplete.js +1 -1
- package/Search/Input.js +1 -1
- package/Search/Parameters.js +1 -1
- package/Search/Popover.js +1 -1
- package/Search/Search.js +1 -1
- package/Search/SearchItem.js +3 -3
- package/Search/utils.js +1 -1
- package/Sidebar/ApiCallItem.js +1 -1
- package/Sidebar/ArrowBack.js +1 -1
- package/Sidebar/BackButton.js +1 -1
- package/Sidebar/Drilldown.js +1 -1
- package/Sidebar/DrilldownMenu.js +2 -2
- package/Sidebar/DrilldownMenuItem.js +3 -3
- package/Sidebar/ExternalIcon.js +1 -1
- package/Sidebar/Menu.js +1 -1
- package/Sidebar/MenuContainer.js +1 -1
- package/Sidebar/MenuGroup.js +6 -2
- package/Sidebar/MenuItemLabel.js +1 -1
- package/Sidebar/MenuLink.js +1 -1
- package/Sidebar/SeparatorItem.js +1 -1
- package/Sidebar/SeparatorLine.js +1 -1
- package/Sidebar/Sidebar.js +1 -1
- package/SidebarLogo/SidebarLogo.js +1 -1
- package/TableOfContent/TableOfContent.js +5 -5
- package/Tooltip/Tooltip.js +1 -1
- package/Typography/H1.js +1 -1
- package/Typography/H2.js +1 -1
- package/Typography/H3.js +1 -1
- package/Typography/SectionHeader.js +1 -1
- package/Typography/Typography.js +1 -1
- package/globalStyle.js +28 -25
- package/icons/ArrowIcon/ArrowIcon.js +1 -1
- package/package.json +1 -1
- package/src/Button/Button.tsx +14 -6
- package/src/CodeBlock/CodeBlock.ts +2 -4
- package/src/ColorModeSwitcher/ColorModeSwitcher.tsx +1 -1
- package/src/Footer/Footer.tsx +3 -2
- package/src/Footer/FooterColumn.tsx +13 -9
- package/src/Footer/FooterColumns.tsx +2 -2
- package/src/Footer/FooterCopyright.tsx +1 -1
- package/src/JsonViewer/JsonViewer.tsx +5 -5
- package/src/LastUpdated/LastUpdated.tsx +32 -0
- package/src/Markdown/Admonition.tsx +3 -2
- package/src/Markdown/CodeSample/CodeSample.tsx +18 -17
- package/src/Markdown/{ContentWrapper.tsx → ContainerWrapper.tsx} +4 -4
- package/src/Markdown/MarkdownLayout.tsx +3 -3
- package/src/Markdown/MarkdownWrapper.tsx +87 -47
- package/src/Markdown/index.ts +1 -1
- package/src/Navbar/MobileNavbarItem.tsx +1 -3
- package/src/Navbar/MobileNavbarMenu.tsx +19 -17
- package/src/Navbar/Navbar.tsx +19 -10
- package/src/Navbar/NavbarDropdown.tsx +2 -1
- package/src/Navbar/NavbarItem.tsx +41 -24
- package/src/Navbar/NavbarMenu.tsx +1 -1
- package/src/NavbarLogo/NavbarLogo.tsx +4 -4
- package/src/OperationBadge/OperationBadge.ts +8 -9
- package/src/Panel/Panel.ts +17 -3
- package/src/Panel/PanelBody.ts +13 -5
- package/src/Panel/PanelComponent.tsx +6 -1
- package/src/Panel/PanelHeader.ts +13 -6
- package/src/Panel/PanelHeaderTitle.ts +6 -4
- package/src/Panel/index.ts +0 -3
- package/src/Profile/Profile.tsx +1 -1
- package/src/SamplesPanelControls/SamplesPanelControls.ts +9 -9
- package/src/Search/Autocomplete.tsx +1 -1
- package/src/Search/Input.tsx +7 -2
- package/src/Search/Parameters.tsx +1 -1
- package/src/Search/Popover.tsx +3 -3
- package/src/Search/Search.tsx +3 -1
- package/src/Search/SearchItem.tsx +14 -9
- package/src/Search/utils.tsx +1 -1
- package/src/Sidebar/ApiCallItem.tsx +7 -0
- package/src/Sidebar/ArrowBack.tsx +1 -1
- package/src/Sidebar/BackButton.tsx +10 -5
- package/src/Sidebar/Drilldown.tsx +1 -3
- package/src/Sidebar/DrilldownMenu.tsx +2 -2
- package/src/Sidebar/DrilldownMenuItem.tsx +12 -8
- package/src/Sidebar/ExternalIcon.tsx +1 -1
- package/src/Sidebar/Menu.tsx +1 -1
- package/src/Sidebar/MenuContainer.tsx +1 -1
- package/src/Sidebar/MenuGroup.tsx +12 -2
- package/src/Sidebar/MenuItemLabel.tsx +7 -7
- package/src/Sidebar/MenuLink.tsx +1 -1
- package/src/Sidebar/SeparatorItem.tsx +5 -1
- package/src/Sidebar/SeparatorLine.tsx +2 -2
- package/src/Sidebar/Sidebar.tsx +4 -4
- package/src/SidebarLogo/SidebarLogo.tsx +3 -3
- package/src/TableOfContent/TableOfContent.tsx +18 -16
- package/src/Tooltip/Tooltip.tsx +2 -2
- package/src/Typography/H1.ts +2 -2
- package/src/Typography/H2.ts +2 -2
- package/src/Typography/H3.ts +2 -1
- package/src/Typography/SectionHeader.ts +4 -4
- package/src/Typography/Typography.ts +1 -1
- package/src/globalStyle.ts +1359 -348
- package/src/icons/ArrowIcon/ArrowIcon.tsx +3 -3
- package/src/settings.yaml +2 -0
- package/src/ui/Background.tsx +1 -1
- package/src/ui/Dropdown.tsx +6 -6
- package/src/ui/Jumbotron.tsx +1 -1
- package/src/ui/Tiles/TileHeader.ts +5 -5
- package/src/ui/Tiles/TileText.tsx +1 -1
- package/src/ui/UniversalLink.tsx +1 -1
- package/src/utils/theme-helpers.ts +1 -1
- package/ui/Background.js +1 -1
- package/ui/Dropdown.js +4 -4
- package/ui/Jumbotron.js +1 -1
- package/ui/Tiles/TileHeader.js +1 -1
- package/ui/Tiles/TileText.js +1 -1
- package/ui/UniversalLink.js +1 -1
- package/utils/theme-helpers.js +1 -1
- package/Markdown/ContentWrapper.d.ts +0 -5
- package/Markdown/ContentWrapper.js +0 -21
- package/Panel/CodePanel.d.ts +0 -5
- package/Panel/CodePanel.js +0 -21
- package/Panel/ContentPanel.d.ts +0 -5
- package/Panel/ContentPanel.js +0 -20
- package/Panel/DarkHeader.d.ts +0 -1
- package/Panel/DarkHeader.js +0 -10
- package/src/Panel/CodePanel.ts +0 -34
- package/src/Panel/ContentPanel.ts +0 -44
- package/src/Panel/DarkHeader.ts +0 -8
|
@@ -29,5 +29,5 @@ var Icon = function (_a) {
|
|
|
29
29
|
react_1.default.createElement("svg", { fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 7 5", className: className },
|
|
30
30
|
react_1.default.createElement("path", { d: "M3.5 2.51L5.806.205a.7.7 0 01.99.99l-2.8 2.8a.698.698 0 01-.99 0l-2.8-2.8a.7.7 0 11.99-.99L3.5 2.51z" }))));
|
|
31
31
|
};
|
|
32
|
-
exports.ArrowIcon = (0, styled_components_1.default)(Icon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: var(--sidebar-chevron-size);\n height: var(--sidebar-chevron-size);\n fill: var(--sidebar-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"], ["\n width: var(--sidebar-chevron-size);\n height: var(--sidebar-chevron-size);\n fill: var(--sidebar-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"])), directionToTransform);
|
|
32
|
+
exports.ArrowIcon = (0, styled_components_1.default)(Icon)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: var(--sidebar-group-item-chevron-size);\n height: var(--sidebar-group-item-chevron-size);\n fill: var(--sidebar-group-item-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"], ["\n width: var(--sidebar-group-item-chevron-size);\n height: var(--sidebar-group-item-chevron-size);\n fill: var(--sidebar-group-item-chevron-color);\n transform: rotate(", "deg);\n\n vertical-align: middle;\n"])), directionToTransform);
|
|
33
33
|
var templateObject_1;
|
package/package.json
CHANGED
package/src/Button/Button.tsx
CHANGED
|
@@ -57,7 +57,7 @@ export const baseButtonStyles = css`
|
|
|
57
57
|
box-shadow: var(--button-box-shadow);
|
|
58
58
|
|
|
59
59
|
&:hover {
|
|
60
|
-
box-shadow: var(--button-
|
|
60
|
+
box-shadow: var(--button-hover-box-shadow);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
&:active {
|
|
@@ -80,15 +80,21 @@ const StyledButton = styled.button.attrs(({ color = 'default', extraClass }: But
|
|
|
80
80
|
variant === 'outlined'
|
|
81
81
|
? css`
|
|
82
82
|
color: var(--button-background-color);
|
|
83
|
-
border: 2px solid var(--button-
|
|
83
|
+
border: 2px solid var(--button-border-color);
|
|
84
84
|
background-color: transparent;
|
|
85
85
|
&:hover {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
color: var(--button-hover-background-color);
|
|
87
|
+
border: 2px solid var(--button-hover-border-color);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
&:active {
|
|
91
|
-
|
|
91
|
+
color: var(--button-active-background-color);
|
|
92
|
+
border: 2px solid var(--button-active-border-color);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:disabled {
|
|
96
|
+
color: var(--button-disabled-background-color);
|
|
97
|
+
background-color: transparent;
|
|
92
98
|
}
|
|
93
99
|
`
|
|
94
100
|
: css`
|
|
@@ -125,7 +131,9 @@ const StyledButton = styled.button.attrs(({ color = 'default', extraClass }: But
|
|
|
125
131
|
&,
|
|
126
132
|
&:hover {
|
|
127
133
|
cursor: default;
|
|
128
|
-
color:
|
|
134
|
+
color: var(--button-disabled-color);
|
|
135
|
+
background-color: var(--button-disabled-background-color);
|
|
136
|
+
border-color: var(--button-disabled-background-color);
|
|
129
137
|
pointer-events: none;
|
|
130
138
|
}
|
|
131
139
|
`}
|
|
@@ -12,8 +12,6 @@ export const CodeBlock = styled.div.attrs(() => ({
|
|
|
12
12
|
*/
|
|
13
13
|
code[class*='language-'],
|
|
14
14
|
pre[class*='language-'] {
|
|
15
|
-
/* color: white;
|
|
16
|
-
background: none; */
|
|
17
15
|
text-shadow: 0 -0.1em 0.2em black;
|
|
18
16
|
text-align: left;
|
|
19
17
|
white-space: pre;
|
|
@@ -62,13 +60,13 @@ export const CodeBlock = styled.div.attrs(() => ({
|
|
|
62
60
|
.token.inserted {
|
|
63
61
|
& + a,
|
|
64
62
|
& + a:visited {
|
|
65
|
-
color:
|
|
63
|
+
color: var(--code-block-tokens-link-color);
|
|
66
64
|
text-decoration: underline;
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
67
|
|
|
70
68
|
.token.property.string {
|
|
71
|
-
color:
|
|
69
|
+
color: var(--code-block-tokens-property-string-color);
|
|
72
70
|
}
|
|
73
71
|
|
|
74
72
|
.token.important,
|
|
@@ -41,7 +41,7 @@ export function ColorModeSwitcher(): JSX.Element | null {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const Wrapper = styled.div`
|
|
44
|
-
margin-left:
|
|
44
|
+
margin-left: var(--navbar-item-padding-horizontal);
|
|
45
45
|
display: flex;
|
|
46
46
|
align-items: center;
|
|
47
47
|
cursor: pointer;
|
package/src/Footer/Footer.tsx
CHANGED
|
@@ -29,11 +29,12 @@ export function Footer({ data: { columns, copyrightText } }: FooterProps): JSX.E
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
const FooterContainer = styled.footer`
|
|
32
|
-
font-size:
|
|
32
|
+
font-size: var(--footer-font-size);
|
|
33
33
|
flex-shrink: 0;
|
|
34
34
|
background-color: var(--footer-background-color);
|
|
35
35
|
color: var(--footer-text-color);
|
|
36
|
-
font-family: var(--font-family
|
|
36
|
+
font-family: var(--footer-font-family);
|
|
37
|
+
font-weight: var(--footer-font-weight);
|
|
37
38
|
a,
|
|
38
39
|
a:hover {
|
|
39
40
|
color: var(--footer-text-color);
|
|
@@ -34,10 +34,11 @@ export function FooterColumn({ column }: FooterColumnProps): JSX.Element {
|
|
|
34
34
|
|
|
35
35
|
const FooterColumnTitle = styled.p`
|
|
36
36
|
display: inline-block;
|
|
37
|
-
font-weight: var(--font-weight
|
|
38
|
-
font-size:
|
|
39
|
-
margin-bottom:
|
|
40
|
-
font-family: var(--
|
|
37
|
+
font-weight: var(--footer-title-font-weight);
|
|
38
|
+
font-size: var(--footer-title-font-size);
|
|
39
|
+
margin-bottom: var(--footer-title-margin-vertical);
|
|
40
|
+
font-family: var(--footer-font-family);
|
|
41
|
+
color: var(--footer-title-text-color);
|
|
41
42
|
`;
|
|
42
43
|
|
|
43
44
|
const FooterSeparator = styled.div`
|
|
@@ -45,21 +46,24 @@ const FooterSeparator = styled.div`
|
|
|
45
46
|
margin: 10px 0 5px 0;
|
|
46
47
|
font-size: 0.75em;
|
|
47
48
|
text-transform: uppercase;
|
|
48
|
-
font-family: var(--
|
|
49
|
+
font-family: var(--footer-font-family);
|
|
49
50
|
`;
|
|
50
51
|
|
|
51
52
|
const FooterColumnContainer = styled.div`
|
|
52
53
|
display: flex;
|
|
53
54
|
flex-direction: column;
|
|
54
55
|
text-align: left;
|
|
55
|
-
margin:
|
|
56
|
-
width:
|
|
56
|
+
margin: var(--footer-column-margin-horizontal) var(--footer-column-margin-vertical);
|
|
57
|
+
width: var(--footer-column-width);
|
|
57
58
|
word-break: break-word;
|
|
58
59
|
`;
|
|
59
60
|
|
|
60
61
|
const FooterLink = styled(Link)`
|
|
61
62
|
font-weight: var(--font-weight-bold);
|
|
62
|
-
padding
|
|
63
|
-
color: var(--footer-text-color);
|
|
63
|
+
padding: var(--footer-item-padding-vertical) var(--footer-item-padding-horizontal);
|
|
64
|
+
color: var(--footer-link-text-color);
|
|
64
65
|
text-decoration: none;
|
|
66
|
+
&:hover {
|
|
67
|
+
color: var(--footer-link-hover-color);
|
|
68
|
+
}
|
|
65
69
|
`;
|
|
@@ -26,11 +26,11 @@ export function FooterColumns({ columns }: FooterColumnsProps): JSX.Element | nu
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export const FooterColumnsContainer = styled.div`
|
|
29
|
-
padding:
|
|
29
|
+
padding: var(--footer-padding-vertical) var(--footer-padding-horizontal);
|
|
30
30
|
display: flex;
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
justify-content: center;
|
|
33
|
-
max-width:
|
|
33
|
+
max-width: var(--footer-container-max-width);
|
|
34
34
|
margin: 0 auto;
|
|
35
35
|
|
|
36
36
|
${({ theme }) => theme.mediaQueries.small} {
|
|
@@ -115,8 +115,8 @@ export const JsonViewer = styled(Json).attrs(() => ({
|
|
|
115
115
|
'data-component-name': 'JsonViewer/JsonViewer',
|
|
116
116
|
}))<JsonProps>`
|
|
117
117
|
.redoc-json code {
|
|
118
|
-
background-color: var(--samples-
|
|
119
|
-
color: var(--color-
|
|
118
|
+
background-color: var(--panel-samples-code-block-background-color);
|
|
119
|
+
color: var(--text-color-inverse);
|
|
120
120
|
padding: inherit;
|
|
121
121
|
border: none;
|
|
122
122
|
}
|
|
@@ -125,9 +125,9 @@ export const JsonViewer = styled(Json).attrs(() => ({
|
|
|
125
125
|
overflow-x: auto;
|
|
126
126
|
position: relative;
|
|
127
127
|
padding: 10px;
|
|
128
|
-
border-radius: var(--
|
|
129
|
-
background-color: var(--samples-
|
|
130
|
-
color: var(--color-
|
|
128
|
+
border-radius: var(--border-radius);
|
|
129
|
+
background-color: var(--panel-samples-code-block-background-color);
|
|
130
|
+
color: var(--text-color-inverse);
|
|
131
131
|
font-size: var(--code-font-size);
|
|
132
132
|
font-family: var(--code-font-family);
|
|
133
133
|
white-space: var(--code-wrap, pre);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { format } from 'timeago.js';
|
|
4
|
+
|
|
5
|
+
import { useThemeSettings } from '@portal/hooks';
|
|
6
|
+
import { DEFAULT_THEME_NAME } from '@portal/constants';
|
|
7
|
+
|
|
8
|
+
export interface LastUpdatedProps {
|
|
9
|
+
lastModified: string | Date;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function LastUpdated({ lastModified }: LastUpdatedProps): JSX.Element | null {
|
|
13
|
+
const { lastUpdatedBlock } = useThemeSettings(DEFAULT_THEME_NAME);
|
|
14
|
+
|
|
15
|
+
if (lastUpdatedBlock?.hide) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Wrapper data-component-name="LastUpdated/LastUpdated">
|
|
21
|
+
Last updated {format(lastModified)}
|
|
22
|
+
</Wrapper>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const Wrapper = styled.time`
|
|
27
|
+
color: var(--last-updated-text-color);
|
|
28
|
+
font-size: var(--last-updated-font-size);
|
|
29
|
+
font-family: var(--last-updated-font-family);
|
|
30
|
+
line-height: var(--last-updated-line-height);
|
|
31
|
+
padding-bottom: 20px;
|
|
32
|
+
`;
|
|
@@ -39,6 +39,7 @@ const Wrapper = styled.div<AdmonitionTypeProps>`
|
|
|
39
39
|
${({ type }) => `
|
|
40
40
|
background-color: var(--admonition-${type}-background-color);
|
|
41
41
|
color: var(--admonition-${type}-text-color);
|
|
42
|
+
border: var(--admonition-${type}-border);
|
|
42
43
|
`}
|
|
43
44
|
`;
|
|
44
45
|
|
|
@@ -47,13 +48,13 @@ const Heading = styled.h5<AdmonitionTypeProps>`
|
|
|
47
48
|
margin: 0 0 10px;
|
|
48
49
|
|
|
49
50
|
letter-spacing: var(--admonition-heading-letter-spacing);
|
|
50
|
-
color: ${({ type }) => `var(--admonition-${type}-text-color)`};
|
|
51
|
+
color: ${({ type }) => `var(--admonition-${type}-heading-text-color)`};
|
|
51
52
|
|
|
52
53
|
&& {
|
|
53
54
|
font-size: var(--admonition-heading-font-size);
|
|
54
55
|
font-weight: var(--admonition-heading-font-weight);
|
|
55
56
|
line-height: var(--admonition-line-height);
|
|
56
|
-
transform: var(--admonition-heading-transform);
|
|
57
|
+
text-transform: var(--admonition-heading-transform);
|
|
57
58
|
}
|
|
58
59
|
`;
|
|
59
60
|
|
|
@@ -40,17 +40,20 @@ const CodeSampleButtonContainer = styled.div`
|
|
|
40
40
|
`;
|
|
41
41
|
|
|
42
42
|
const CopyCodeButton = styled.div`
|
|
43
|
-
padding:
|
|
44
|
-
border-radius:
|
|
45
|
-
|
|
43
|
+
padding: var(--code-block-controls-padding);
|
|
44
|
+
border-radius: var(--code-block-controls-border-radius);
|
|
45
|
+
font-size: var(--code-block-controls-font-size);
|
|
46
|
+
font-family: var(--code-block-controls-font-family);
|
|
46
47
|
&:hover {
|
|
47
48
|
cursor: pointer;
|
|
48
49
|
}
|
|
49
50
|
`;
|
|
50
51
|
|
|
51
52
|
const DoneIndicator = styled.div`
|
|
52
|
-
padding:
|
|
53
|
-
border-radius:
|
|
53
|
+
padding: var(--code-block-controls-padding);
|
|
54
|
+
border-radius: var(--code-block-controls-border-radius);
|
|
55
|
+
font-size: var(--code-block-controls-font-size);
|
|
56
|
+
font-family: var(--code-block-controls-font-family);
|
|
54
57
|
cursor: default;
|
|
55
58
|
`;
|
|
56
59
|
|
|
@@ -111,32 +114,30 @@ const Wrapper = styled.div`
|
|
|
111
114
|
|
|
112
115
|
${CopyCodeButton},
|
|
113
116
|
${DoneIndicator} {
|
|
114
|
-
color:
|
|
117
|
+
color: var(--code-block-controls-text-color);
|
|
118
|
+
background-color: var(--code-block-controls-background-color);
|
|
119
|
+
opacity: var(--code-block-controls-opacity);
|
|
115
120
|
}
|
|
116
121
|
${CopyCodeButton}:hover {
|
|
117
|
-
color:
|
|
118
|
-
background-color:
|
|
122
|
+
color: var(--code-block-controls-hover-text-color);
|
|
123
|
+
background-color: var(--code-block-controls-hover-background-color);
|
|
124
|
+
opacity: var(--code-block-controls-active-opacity);
|
|
119
125
|
}
|
|
120
126
|
|
|
121
|
-
&:hover {
|
|
122
|
-
${CodeSampleButtonContainer} ${CopyCodeButton} {
|
|
123
|
-
display: block;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
127
|
pre {
|
|
127
128
|
white-space: var(--code-wrap);
|
|
128
129
|
color: white;
|
|
129
130
|
padding: 12px 14px 15px 14px;
|
|
130
131
|
overflow-x: auto;
|
|
131
132
|
line-height: normal;
|
|
132
|
-
border-radius:
|
|
133
|
+
border-radius: var(--code-block-border-radius);
|
|
133
134
|
font-family: var(--code-font-family);
|
|
134
|
-
background-color: var(--code-block-
|
|
135
|
+
background-color: var(--code-block-background-color);
|
|
135
136
|
code {
|
|
136
137
|
background-color: transparent;
|
|
137
138
|
border: 0;
|
|
138
139
|
padding: 0;
|
|
139
|
-
color:
|
|
140
|
+
color: var(--code-block-text-color);
|
|
140
141
|
&:before,
|
|
141
142
|
&:after {
|
|
142
143
|
content: none;
|
|
@@ -148,7 +149,7 @@ const Wrapper = styled.div`
|
|
|
148
149
|
margin: 0.5em 0;
|
|
149
150
|
overflow: auto;
|
|
150
151
|
border: 0;
|
|
151
|
-
border-radius: var(--
|
|
152
|
+
border-radius: var(--border-radius);
|
|
152
153
|
}
|
|
153
154
|
code[class='language-text'] {
|
|
154
155
|
line-height: 1.2em;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
'data-component-name': 'Markdown/
|
|
3
|
+
export const ContainerWrapper = styled.section.attrs(() => ({
|
|
4
|
+
'data-component-name': 'Markdown/ContainerWrapper',
|
|
5
5
|
}))<{ withToc: boolean }>`
|
|
6
|
-
max-width: var(--
|
|
6
|
+
max-width: var(--md-container-max-width);
|
|
7
7
|
width: 90%;
|
|
8
8
|
margin: 0 auto;
|
|
9
9
|
|
|
10
|
-
padding: var(--
|
|
10
|
+
padding: var(--md-container-padding-vertical) var(--md-container-padding-horizontal);
|
|
11
11
|
|
|
12
12
|
& > article:first-child > h1:first-child {
|
|
13
13
|
// disable margin top for h1 on the title heading if there is no "Last updated at" block
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import { PageWrapper } from '@theme/Markdown/PageWrapper';
|
|
4
|
-
import {
|
|
4
|
+
import { ContainerWrapper } from '@theme/Markdown/ContainerWrapper';
|
|
5
5
|
import { PageNavigation } from '@theme/PageNavigation/PageNavigation';
|
|
6
6
|
|
|
7
7
|
type MarkdownLayoutProps = {
|
|
@@ -19,10 +19,10 @@ export function MarkdownLayout({
|
|
|
19
19
|
}: MarkdownLayoutProps): JSX.Element {
|
|
20
20
|
return (
|
|
21
21
|
<PageWrapper data-component-name="Markdown/MarkdownLayout">
|
|
22
|
-
<
|
|
22
|
+
<ContainerWrapper withToc={true}>
|
|
23
23
|
{markdownWrapper}
|
|
24
24
|
<PageNavigation showPrevButton={showPrevButton} showNextButton={showNextButton} />
|
|
25
|
-
</
|
|
25
|
+
</ContainerWrapper>
|
|
26
26
|
{tableOfContent}
|
|
27
27
|
</PageWrapper>
|
|
28
28
|
);
|
|
@@ -10,60 +10,65 @@ export const baseTable = css`
|
|
|
10
10
|
word-break: keep-all;
|
|
11
11
|
border-collapse: separate;
|
|
12
12
|
border-spacing: 0;
|
|
13
|
-
margin-top:
|
|
14
|
-
margin-bottom:
|
|
15
|
-
font-size:
|
|
13
|
+
margin-top: var(--md-table-margin-vertical);
|
|
14
|
+
margin-bottom: var(--md-table-margin-vertical);
|
|
15
|
+
font-size: var(--md-table-font-size);
|
|
16
16
|
|
|
17
17
|
th,
|
|
18
18
|
td {
|
|
19
|
-
padding:
|
|
20
|
-
border-bottom: 1px solid var(--
|
|
19
|
+
padding: var(--md-table-cell-padding);
|
|
20
|
+
border-bottom: 1px solid var(--md-table-border-color);
|
|
21
|
+
color: var(--md-table-cell-text-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
tr {
|
|
25
|
+
background-color: var(--md-table-stripe-background-color);
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
th {
|
|
24
29
|
text-align: left;
|
|
25
|
-
font-weight:
|
|
26
|
-
|
|
30
|
+
font-weight: var(--md-table-head-font-weight);
|
|
31
|
+
color: var(--md-table-head-text-color);
|
|
32
|
+
background-color: var(--md-table-head-background-color);
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
tr th:first-child,
|
|
30
36
|
tr td:first-child {
|
|
31
|
-
border-left: 1px solid var(--
|
|
37
|
+
border-left: 1px solid var(--md-table-border-color);
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
tr td:last-child,
|
|
35
41
|
tr th:last-child {
|
|
36
|
-
border-right: 1px solid var(--
|
|
42
|
+
border-right: 1px solid var(--md-table-border-color);
|
|
37
43
|
}
|
|
38
44
|
|
|
39
45
|
thead td,
|
|
40
46
|
thead th {
|
|
41
|
-
border-top: 1px solid var(--
|
|
47
|
+
border-top: 1px solid var(--md-table-border-color);
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
/* top-left border */
|
|
45
51
|
|
|
46
52
|
thead tr:first-child th:first-child {
|
|
47
|
-
border-top-left-radius: var(--
|
|
53
|
+
border-top-left-radius: var(--md-table-border-radius);
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
/* top-right border */
|
|
51
57
|
|
|
52
58
|
thead tr:first-child th:last-child {
|
|
53
|
-
border-top-right-radius: var(--
|
|
54
|
-
border-top: 1px solid var(--global-border-color);
|
|
59
|
+
border-top-right-radius: var(--md-table-border-radius);
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
/* bottom-left border */
|
|
58
63
|
|
|
59
64
|
tbody tr:last-child td:first-child {
|
|
60
|
-
border-bottom-left-radius: var(--
|
|
65
|
+
border-bottom-left-radius: var(--md-table-border-radius);
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
/* bottom-right border */
|
|
64
69
|
|
|
65
70
|
tbody tr:last-child td:last-child {
|
|
66
|
-
border-bottom-right-radius: var(--
|
|
71
|
+
border-bottom-right-radius: var(--md-table-border-radius);
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
`;
|
|
@@ -75,7 +80,7 @@ export function headingAnchor(className = 'anchor'): FlattenSimpleInterpolation
|
|
|
75
80
|
position: absolute;
|
|
76
81
|
left: 0;
|
|
77
82
|
transform: translateX(-100%);
|
|
78
|
-
padding-right:
|
|
83
|
+
padding-right: var(--heading-anchor-offset-right);
|
|
79
84
|
}
|
|
80
85
|
|
|
81
86
|
.${className}.after {
|
|
@@ -85,6 +90,7 @@ export function headingAnchor(className = 'anchor'): FlattenSimpleInterpolation
|
|
|
85
90
|
|
|
86
91
|
svg,
|
|
87
92
|
.${className} svg {
|
|
93
|
+
fill: var(--heading-anchor-color);
|
|
88
94
|
visibility: hidden;
|
|
89
95
|
}
|
|
90
96
|
|
|
@@ -101,21 +107,29 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
101
107
|
font-weight: var(--font-weight-regular);
|
|
102
108
|
padding: 0;
|
|
103
109
|
|
|
104
|
-
color: var(--color
|
|
110
|
+
color: var(--text-color);
|
|
105
111
|
font-size: var(--font-size-base);
|
|
106
112
|
font-family: var(--font-family-base);
|
|
107
113
|
line-height: var(--line-height-base);
|
|
108
114
|
|
|
109
115
|
a:not([role='button']) {
|
|
110
116
|
text-decoration: var(--link-decoration);
|
|
111
|
-
color: var(--link-color);
|
|
117
|
+
color: var(--link-text-color);
|
|
118
|
+
font-weight: var(--link-font-weight);
|
|
112
119
|
|
|
113
120
|
&:visited {
|
|
114
|
-
color: var(--link-color);
|
|
121
|
+
color: var(--link-visited-text-color);
|
|
122
|
+
text-decoration: var(--link-visited-decoration);
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
&:hover {
|
|
118
|
-
|
|
126
|
+
text-decoration: var(--link-hover-decoration);
|
|
127
|
+
color: var(--link-hover-text-color);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&:focus {
|
|
131
|
+
color: var(--link-active-text-color);
|
|
132
|
+
text-decoration: var(--link-active-decoration);
|
|
119
133
|
}
|
|
120
134
|
}
|
|
121
135
|
|
|
@@ -129,8 +143,8 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
129
143
|
h4.md,
|
|
130
144
|
h5.md,
|
|
131
145
|
h6.md {
|
|
132
|
-
font-weight: var(--
|
|
133
|
-
font-family: var(--
|
|
146
|
+
font-weight: var(--heading-font-weight);
|
|
147
|
+
font-family: var(--heading-font-family);
|
|
134
148
|
position: relative;
|
|
135
149
|
|
|
136
150
|
scroll-margin-top: 60px;
|
|
@@ -141,14 +155,17 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
hr {
|
|
144
|
-
border-top: 1px solid var(--
|
|
158
|
+
border-top: 1px solid var(--md-hr-border-color);
|
|
159
|
+
background-color: var(--md-hr-background-color);
|
|
160
|
+
height: var(--md-hr-height);
|
|
161
|
+
margin: var(--md-hr-margin-vertical) 0;
|
|
145
162
|
}
|
|
146
163
|
|
|
147
164
|
details {
|
|
148
165
|
margin: 1.125em 0;
|
|
149
166
|
|
|
150
167
|
summary {
|
|
151
|
-
color: var(--color
|
|
168
|
+
color: var(--text-color);
|
|
152
169
|
font-weight: var(--font-weight-regular);
|
|
153
170
|
outline: 0;
|
|
154
171
|
padding: 0;
|
|
@@ -170,17 +187,17 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
170
187
|
.snippets-tabs-headers {
|
|
171
188
|
font-size: 0.9em;
|
|
172
189
|
|
|
173
|
-
font-family: var(--
|
|
190
|
+
font-family: var(--heading-font-family);
|
|
174
191
|
|
|
175
192
|
.tab-header {
|
|
176
193
|
text-align: center;
|
|
177
194
|
padding: 0.2em 0.5em;
|
|
178
195
|
display: inline-block;
|
|
179
196
|
cursor: pointer;
|
|
180
|
-
color: var(--color-
|
|
197
|
+
color: var(--text-color-secondary);
|
|
181
198
|
|
|
182
199
|
&.active {
|
|
183
|
-
color: var(--
|
|
200
|
+
color: var(--heading-text-color);
|
|
184
201
|
font-weight: var(--font-weight-bold);
|
|
185
202
|
}
|
|
186
203
|
}
|
|
@@ -201,6 +218,8 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
201
218
|
}
|
|
202
219
|
|
|
203
220
|
p {
|
|
221
|
+
margin: var(--md-paragraph-margin-vertical) var(--md-paragraph-margin-horizontal);
|
|
222
|
+
|
|
204
223
|
&:last-child {
|
|
205
224
|
margin-bottom: 0;
|
|
206
225
|
}
|
|
@@ -271,24 +290,25 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
271
290
|
}
|
|
272
291
|
|
|
273
292
|
code {
|
|
274
|
-
color: var(--inline-code-color);
|
|
293
|
+
color: var(--inline-code-text-color);
|
|
275
294
|
background-color: var(--inline-code-background-color);
|
|
276
295
|
|
|
277
|
-
border-radius:
|
|
278
|
-
border: 1px solid var(--
|
|
296
|
+
border-radius: var(--inline-code-border-radius);
|
|
297
|
+
border: 1px solid var(--inline-code-border-color);
|
|
279
298
|
padding: 0.1em 0.25em 0.2em;
|
|
280
299
|
font-weight: var(--code-font-weight);
|
|
281
300
|
word-break: break-word;
|
|
282
|
-
font-size: var(--code-font-size);
|
|
301
|
+
font-size: var(--inline-code-font-size);
|
|
283
302
|
font-family: var(--code-font-family);
|
|
284
303
|
}
|
|
285
304
|
|
|
286
305
|
blockquote {
|
|
287
|
-
margin: var(--
|
|
288
|
-
padding: var(--
|
|
289
|
-
border-left:
|
|
290
|
-
background-color: var(--
|
|
291
|
-
color: var(--color
|
|
306
|
+
margin: var(--md-blockquote-margin-vertical) var(--md-blockquote-margin-horizontal);
|
|
307
|
+
padding: var(--md-blockquote-padding-vertical) var(--md-blockquote-padding-horizontal);
|
|
308
|
+
border-left: var(--md-blockquote-border-left);
|
|
309
|
+
background-color: var(--md-blockquote-background-color);
|
|
310
|
+
color: var(--md-blockquote-text-color);
|
|
311
|
+
box-shadow: var(--md-blockquote-box-shadow);
|
|
292
312
|
|
|
293
313
|
& > p:first-child {
|
|
294
314
|
margin-top: 0;
|
|
@@ -305,18 +325,38 @@ export const MarkdownWrapper = styled.main.attrs(() => ({
|
|
|
305
325
|
}
|
|
306
326
|
}
|
|
307
327
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
padding-left: 2em;
|
|
313
|
-
margin: 0 0 1em;
|
|
328
|
+
ul,
|
|
329
|
+
ol {
|
|
330
|
+
padding-left: var(--md-list-left-padding);
|
|
331
|
+
margin: 0 0 var(--md-list-margin);
|
|
314
332
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
}
|
|
333
|
+
ul,
|
|
334
|
+
ol {
|
|
335
|
+
margin-bottom: 0;
|
|
336
|
+
margin-top: 0;
|
|
320
337
|
}
|
|
321
338
|
}
|
|
339
|
+
|
|
340
|
+
li {
|
|
341
|
+
margin: var(--md-list-item-margin);
|
|
342
|
+
list-style: var(--md-list-item-style);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
ol > li {
|
|
346
|
+
list-style: var(--md-numbered-list-item-style);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
ol > li:before {
|
|
350
|
+
content: counter(list-item);
|
|
351
|
+
display: var(--md-numbered-list-number-display);
|
|
352
|
+
color: var(--md-numbered-list-number-text-color);
|
|
353
|
+
font-size: var(--md-numbered-list-number-font-size);
|
|
354
|
+
font-family: var(--md-numbered-list-number-font-family);
|
|
355
|
+
font-weight: var(--md-numbered-list-number-font-weight);
|
|
356
|
+
background-color: var(--md-numbered-list-number-background-color);
|
|
357
|
+
border-radius: var(--md-numbered-list-number-border-radius);
|
|
358
|
+
border: var(--md-numbered-list-number-border);
|
|
359
|
+
margin-right: var(--md-numbered-list-number-margin-right);
|
|
360
|
+
padding: var(--md-numbered-list-number-padding);
|
|
361
|
+
}
|
|
322
362
|
`;
|
package/src/Markdown/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from '@theme/Markdown/Admonition';
|
|
2
2
|
export * from '@theme/Markdown/CodeSample';
|
|
3
|
-
export * from '@theme/Markdown/
|
|
3
|
+
export * from '@theme/Markdown/ContainerWrapper';
|
|
4
4
|
export * from '@theme/Markdown/Heading';
|
|
5
5
|
export * from '@theme/Markdown/MarkdownLayout';
|
|
6
6
|
export * from '@theme/Markdown/MarkdownWrapper';
|