Fix OpenAPI HTML descriptions in darkmode

Currently when an OpenAPI specification contains HTML in the description fields
it is not rendered with the correct theme font colors making the description
unreadable in darkmode.

This change adds an additional selector to the style theme that correctly
selects the description block and ensures colors follows the theme.

Signed-off-by: Crevil <bjoern.soerensen@gmail.com>
This commit is contained in:
Crevil
2022-07-08 21:49:15 +02:00
parent 5e6ef0a660
commit 9432a05cf3
2 changed files with 10 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-api-docs': patch
---
Set font colors correctly for descriptions containing HTML
@@ -53,6 +53,7 @@ const useStyles = makeStyles(theme => ({
.opblock-summary-operation-id,
.opblock-summary-path,
.opblock-summary-path__deprecated,
.opblock-description-wrapper,
.opblock-external-docs-wrapper,
.opblock-section-header .btn,
.opblock-section-header>label,
@@ -66,7 +67,7 @@ const useStyles = makeStyles(theme => ({
fontFamily: theme.typography.fontFamily,
color: theme.palette.text.primary,
},
[`& .opblock .opblock-section-header,
[`& .opblock .opblock-section-header,
.model-box,
section.models .model-container`]: {
background: theme.palette.background.default,
@@ -75,7 +76,7 @@ const useStyles = makeStyles(theme => ({
.parameter__in`]: {
color: theme.palette.text.disabled,
},
[`& table.model,
[`& table.model,
.parameter__type,
.model.model-title,
.model-title,
@@ -91,7 +92,7 @@ const useStyles = makeStyles(theme => ({
[`& .parameter__name.required:after`]: {
color: theme.palette.warning.dark,
},
[`& table.model,
[`& table.model,
table.model .model,
.opblock-external-docs-wrapper`]: {
fontSize: theme.typography.fontSize,
@@ -104,7 +105,7 @@ const useStyles = makeStyles(theme => ({
color: theme.palette.text.hint,
backgroundColor: theme.palette.background.paper,
},
[`& .opblock-summary-method,
[`& .opblock-summary-method,
.info a`]: {
fontFamily: theme.typography.fontFamily,
},