Skip to content

Commit 8202b54

Browse files
authored
Fix mobile css bug (#129)
1 parent 244cfca commit 8202b54

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/docusaurus-theme-openapi/src/theme/ApiItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import clsx from "clsx";
1515

1616
import styles from "./styles.module.css";
1717

18-
let ApiDemoPanel = (_: { item: any }) => <div />;
18+
let ApiDemoPanel = (_: { item: any }) => <div style={{ marginTop: "3.5em" }} />;
1919
if (ExecutionEnvironment.canUseDOM) {
2020
ApiDemoPanel = require("@theme/ApiDemoPanel").default;
2121
}

packages/docusaurus-theme-openapi/src/theme/ApiPage/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function ApiPage(props: Props): JSX.Element {
179179

180180
// Override the current route path to the first page if it can't be found on the sidebar.
181181
const paths = getSidebarPaths({ currentApiRoute, apiMetadata });
182-
if (!paths.includes(location.pathname)) {
182+
if (!paths.find((path) => matchPath(location.pathname, path))) {
183183
currentApiRoute = {
184184
...currentApiRoute,
185185
path: paths[0],

packages/docusaurus-theme-openapi/src/theme/ApiPage/styles.module.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ html[data-theme="dark"] {
5858
display: flex;
5959
}
6060

61-
.apiPage {
61+
.apiPage,
62+
.apiMainContainer {
6263
display: flex;
6364
width: 100%;
6465
}

0 commit comments

Comments
 (0)