diff --git a/.changeset/mighty-jobs-unite.md b/.changeset/mighty-jobs-unite.md new file mode 100644 index 0000000000..c8e880ba3e --- /dev/null +++ b/.changeset/mighty-jobs-unite.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-api-docs': patch +--- + +Uses theme values to style the API definition schema so that theme overrides apply. diff --git a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx index 1505646dee..ea1df525b7 100644 --- a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx +++ b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx @@ -94,7 +94,8 @@ const useStyles = makeStyles(theme => ({ .errors small`]: { color: theme.palette.text.secondary, }, - [`& .parameter__name.required:after`]: { + [`& .parameter__name.required:after, + .parameter__name.required span`]: { color: theme.palette.warning.dark, }, [`& table.model, @@ -132,6 +133,46 @@ const useStyles = makeStyles(theme => ({ [`& span.prop-type`]: { color: theme.palette.success.light, }, + [`& .opblock-control-arrow svg, .authorization__btn .unlocked`]: { + fill: theme.palette.text.primary, + }, + [`& .json-schema-2020-12__title, + .json-schema-2020-12-keyword__name, + .json-schema-2020-12-property .json-schema-2020-12__title, + .json-schema-2020-12-keyword--description`]: { + color: theme.palette.text.primary, + }, + [`.json-schema-2020-12-accordion__icon svg`]: { + fill: theme.palette.text.primary, + }, + [`& .json-schema-2020-12-accordion, + .json-schema-2020-12-expand-deep-button`]: { + background: 'none', + appearance: 'none', + }, + [`& .json-schema-2020-12-expand-deep-button, + .json-schema-2020-12-keyword__name--secondary, + .json-schema-2020-12-keyword__value--secondary, + .json-schema-2020-12__attribute--muted, + .json-schema-2020-12-keyword__value--const, + .json-schema-2020-12-keyword__value--warning`]: { + color: theme.palette.text.secondary, + }, + [`& .json-schema-2020-12-body, + .json-schema-2020-12-keyword__value--const, + .json-schema-2020-12-keyword__value--warning`]: { + borderColor: theme.palette.text.secondary, + }, + [`.json-schema-2020-12__constraint--string`]: { + backgroundColor: theme.palette.primary.main, + }, + [`& .json-schema-2020-12__attribute--primary`]: { + color: theme.palette.primary.main, + }, + [`& .json-schema-2020-12-property--required>.json-schema-2020-12:first-of-type>.json-schema-2020-12-head .json-schema-2020-12__title:after`]: + { + color: theme.palette.warning.dark, + }, }, }, }));