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:
@@ -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.
|
||||
@@ -81,6 +81,9 @@ export type BackstagePaletteAdditions = {
|
||||
closeButtonColor?: string;
|
||||
warning?: string;
|
||||
};
|
||||
code: {
|
||||
background?: string;
|
||||
};
|
||||
};
|
||||
|
||||
// @public @deprecated
|
||||
|
||||
@@ -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: ${
|
||||
|
||||
Reference in New Issue
Block a user