-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad66f92
commit d2438dd
Showing
10 changed files
with
49 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'docusaurus-theme-redoc': major | ||
--- | ||
|
||
Enable server style sheet collection by default, fixes style issues on fresh load |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/docusaurus-theme-redoc/src/theme/Redoc/ServerStyles.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { AppStore, Redoc } from 'redoc'; | ||
// eslint-disable-next-line import/no-extraneous-dependencies | ||
import { renderToString } from 'react-dom/server'; | ||
import { ServerStyleSheet } from 'styled-components'; | ||
|
||
export function ServerStyles({ store }: { store: AppStore }) { | ||
const sheet = new ServerStyleSheet(); | ||
renderToString(sheet.collectStyles(React.createElement(Redoc, { store }))); | ||
const css = sheet.getStyleTags(); | ||
|
||
return ( | ||
<div | ||
className="redocusaurus-styles" | ||
dangerouslySetInnerHTML={{ | ||
__html: css, | ||
}} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { AppStore } from 'redoc'; | ||
|
||
function ClientStyles(_props: { store: AppStore }) { | ||
return null; | ||
} | ||
|
||
export { ClientStyles as ServerStyles }; |
49 changes: 0 additions & 49 deletions
49
packages/docusaurus-theme-redoc/src/theme/ServerStyle/index.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.