From 0bd87308557406fb91d10cc88b31b3a5277f17df Mon Sep 17 00:00:00 2001 From: Jonathan Roebuck Date: Tue, 15 Oct 2024 14:07:11 +0100 Subject: [PATCH] Use theme values for OpenApiDefinition styles Signed-off-by: Jonathan Roebuck --- .../OpenApiDefinition.tsx | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx index 1505646dee..58b1a277a5 100644 --- a/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx +++ b/plugins/api-docs/src/components/OpenApiDefinitionWidget/OpenApiDefinition.tsx @@ -132,6 +132,48 @@ 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, + .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.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, + }, }, }, }));