From b5ee8b0a5330d5ae641dc30349372dce508917ed Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 8 Jul 2021 12:14:38 +0200 Subject: [PATCH 1/2] Add styles for scrollbars in long code blocks. #5467 Co-authored-by: Camila Belo Co-authored-by: Raghunandan Balachandran Signed-off-by: Eric Peterson --- plugins/techdocs/src/reader/components/Reader.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/techdocs/src/reader/components/Reader.tsx b/plugins/techdocs/src/reader/components/Reader.tsx index f80cf6cc4c..294f81378f 100644 --- a/plugins/techdocs/src/reader/components/Reader.tsx +++ b/plugins/techdocs/src/reader/components/Reader.tsx @@ -184,6 +184,17 @@ export const Reader = ({ entityId, onReady }: Props) => { } `, }), + injectCss({ + // Properly style code blocks. + css: ` + .md-typeset pre > code::-webkit-scrollbar-thumb { + background-color: hsla(0, 0%, 0%, 0.32); + } + .md-typeset pre > code::-webkit-scrollbar-thumb:hover { + background-color: hsla(0, 0%, 0%, 0.87); + } + `, + }), injectCss({ // Admonitions and others are using SVG masks to define icons. These // masks are defined as CSS variables. From 0172d3424b1943e1f8ff6e65ffbc6b005aecdd03 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 8 Jul 2021 12:24:18 +0200 Subject: [PATCH 2/2] Changeset Signed-off-by: Eric Peterson --- .changeset/techdocs-lamp-lit-prose.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/techdocs-lamp-lit-prose.md diff --git a/.changeset/techdocs-lamp-lit-prose.md b/.changeset/techdocs-lamp-lit-prose.md new file mode 100644 index 0000000000..69c19c7188 --- /dev/null +++ b/.changeset/techdocs-lamp-lit-prose.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Fixed bug preventing scroll bar from showing up on code blocks in a TechDocs site.