diff --git a/src/components/DevModePanel/DevModePanel.tsx b/src/components/DevModePanel/DevModePanel.tsx index 6a26d8e53..290526faa 100644 --- a/src/components/DevModePanel/DevModePanel.tsx +++ b/src/components/DevModePanel/DevModePanel.tsx @@ -1,3 +1,4 @@ +import { useDashboardTheme } from "@dashboard/components/GraphiQL/styles"; import { createGraphiQLFetcher } from "@graphiql/toolkit"; import { Dialog, DialogContent } from "@material-ui/core"; import { DialogHeader } from "@saleor/macaw-ui"; @@ -26,9 +27,22 @@ export const DevModePanel: React.FC = ({ }); const intl = useIntl(); + const { rootStyle } = useDashboardTheme(); const { devModeContent, variables } = useDevModeContext(); + const overwriteCodeMirrorCSSVariables = { + __html: ` + .graphiql-container, .CodeMirror-info, .CodeMirror-lint-tooltip, reach-portal{ + --font-size-hint: ${rootStyle["--font-size-hint"]} !important; + --font-size-inline-code: ${rootStyle["--font-size-inline-code"]} !important; + --font-size-body: ${rootStyle["--font-size-body"]} !important; + --font-size-h4: ${rootStyle["--font-size-h4"]} !important; + --font-size-h3: ${rootStyle["--font-size-h3"]} !important; + --font-size-h2: ${rootStyle["--font-size-h2"]} !important; + `, + }; + return ( = ({ style={{ zIndex: 5 }} PaperProps={{ style: { height: "100%" } }} > + setDevModeVisibility(false)}> {intl.formatMessage(messages.title)} diff --git a/src/components/GraphiQL/GraphiQL.tsx b/src/components/GraphiQL/GraphiQL.tsx index 042d89211..ab40ed4e2 100644 --- a/src/components/GraphiQL/GraphiQL.tsx +++ b/src/components/GraphiQL/GraphiQL.tsx @@ -205,12 +205,25 @@ export function GraphiQLInterface(props: GraphiQLInterfaceProps) { } }; + const overwriteCodeMirrorCSSVariables = { + __html: ` + .graphiql-container, .CodeMirror-info, .CodeMirror-lint-tooltip, reach-portal{ + --font-size-hint: ${rootStyle["--font-size-hint"]} !important; + --font-size-inline-code: ${rootStyle["--font-size-inline-code"]} !important; + --font-size-body: ${rootStyle["--font-size-body"]} !important; + --font-size-h4: ${rootStyle["--font-size-h4"]} !important; + --font-size-h3: ${rootStyle["--font-size-h3"]} !important; + --font-size-h2: ${rootStyle["--font-size-h2"]} !important; + `, + }; + return (
+
{pluginContext?.plugins.map(plugin => {