Merge pull request #26953 from backstage/jroebu14-techdocs-customisable-code-bg-colour

add customisable techdocs code bg color that defaults to background.paper
This commit is contained in:
Fredrik Adelöw
2024-10-08 11:07:44 +02:00
committed by GitHub
4 changed files with 15 additions and 1 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-techdocs': minor
'@backstage/theme': minor
---
Adds support for custom background colors in code blocks and inline code within TechDocs.
+3
View File
@@ -81,6 +81,9 @@ export type BackstagePaletteAdditions = {
closeButtonColor?: string;
warning?: string;
};
code: {
background?: string;
};
};
// @public @deprecated
+3
View File
@@ -82,6 +82,9 @@ export type BackstagePaletteAdditions = {
closeButtonColor?: string;
warning?: string;
};
code: {
background?: string;
};
};
/**
@@ -108,7 +108,9 @@ export default ({ theme }: RuleOptions) => `
:host > * {
/* CODE */
--md-code-fg-color: ${theme.palette.text.primary};
--md-code-bg-color: ${theme.palette.background.paper};
--md-code-bg-color: ${
theme.palette.code?.background ?? theme.palette.background.paper
};
--md-code-hl-color: ${alpha(theme.palette.warning.main, 0.5)};
--md-code-hl-color--light: var(--md-code-hl-color);
--md-code-hl-keyword-color: ${