Skip to content

Commit

Permalink
Fixup API docs styling
Browse files Browse the repository at this point in the history
  • Loading branch information
GideonShils committed Oct 30, 2023
1 parent 35a5949 commit a0ad50d
Show file tree
Hide file tree
Showing 5 changed files with 162 additions and 19 deletions.
4 changes: 3 additions & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,9 @@ var siteSettings = {
"/css/fonts.css",
"/css/entypo.css",
"/css/search.css",
"/css/api.css",
"/css/redoc.css",
"/css/stoplight-base.css",
"/css/stoplight-custom.css",
"https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;500;600;700&display=swap",
"https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;500;600;700&display=swap",
{
Expand Down
27 changes: 10 additions & 17 deletions website/src/components/stoplight/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ export default function Stoplight({ version }) {
return null;
}
return (
<>
<link
href="https://unpkg.com/@stoplight/elements/styles.min.css"
type="text/css"
rel="stylesheet"
/>
<API
apiDescriptionUrl={
"https://raw.githubusercontent.com/dbt-labs/dbt-cloud-openapi-spec/master/openapi-" +
version +
".yaml"
}
platformUrl={useBaseUrl("/")}
basePath={useBaseUrl("/dbt-cloud/api-" + version) + "#"}
hideSchemas
/>
</>
<API
apiDescriptionUrl={
"https://raw.githubusercontent.com/dbt-labs/dbt-cloud-openapi-spec/master/openapi-" +
version +
".yaml"
}
platformUrl={useBaseUrl("/")}
basePath={useBaseUrl("/dbt-cloud/api-" + version) + "#"}
hideSchemas
/>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ div.redoc-json code span.token {

div.redoc-json code {
background-color: #11171b;

}
111 changes: 111 additions & 0 deletions website/static/css/stoplight-base.css

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions website/static/css/stoplight-custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
[data-theme="dark"] {
--stoplight-pre-background: #ebedf0;
--stoplight-pre-color: #333333;
}

[data-theme="light"] {
--stoplight-pre-background: var(--ifm-pre-background);
--stoplight-pre-color: var(--ifm-pre-color);
}

.sl-font-ui, .sl-font-prose, .sl-prose, .sl-button {
/* Ensure we use the same font in stoplight docs as in the rest of the docs site */
font-family: var(--ifm-font-family-base) !important;
}

.sl-text-base {
/* Bump font size to make up for slightly smaller font family (above) */
font-size: 13px !important;
}

.sl-font-ui {
/* Bump font size to make up for slightly smaller font family (above) */
font-size: 14px !important;

& a {
/* Ensure link colors aren't overriden by docusaurus css */
color: var(--color-text) !important;
}
}

/* Ensure codeblocks are legible when using darkmode */
.sl-panel__content pre {
background-color: var(--stoplight-pre-background) !important;

& .plain, .sl-code-highlight__ln {
color: var(--stoplight-pre-color) !important;
}
}

0 comments on commit a0ad50d

Please sign in to comment.