From 028de87f074284215b01ca1daf152733e80ae422 Mon Sep 17 00:00:00 2001 From: Yangshun Tay Date: Thu, 2 Apr 2020 13:54:07 +0800 Subject: [PATCH] fix(v2): make code block nicer --- .../src/theme/CodeBlock/styles.module.css | 13 ++++++------- .../src/theme/CodeBlock/styles.module.css | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css b/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css index 473800e62ca6..d7ced44e1021 100644 --- a/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css +++ b/packages/docusaurus-theme-classic/src/theme/CodeBlock/styles.module.css @@ -10,11 +10,10 @@ } .codeBlockTitle { - border-top-left-radius: var(--ifm-pre-border-radius); - border-top-right-radius: var(--ifm-pre-border-radius); + font-family: var(--ifm-font-family-monospace); font-weight: bold; - padding: 4px 12px; - border-bottom: 1px solid; + padding: var(--ifm-pre-padding); + border-bottom: 1px solid var(--ifm-color-emphasis-200); width: 100%; } @@ -31,10 +30,10 @@ } .copyButton { - background: rgb(1, 22, 39); - border: 1px solid rgb(214, 222, 235); + background: rgba(0, 0, 0, 0.3); + border: none; border-radius: var(--ifm-global-radius); - color: rgb(214, 222, 235); + color: var(--ifm-color-content); cursor: pointer; line-height: 12px; opacity: 0; diff --git a/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css b/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css index 436785d61bd6..cee4986566e7 100644 --- a/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css +++ b/packages/docusaurus-theme-live-codeblock/src/theme/CodeBlock/styles.module.css @@ -10,11 +10,10 @@ } .codeBlockTitle { - border-top-left-radius: var(--ifm-pre-border-radius); - border-top-right-radius: var(--ifm-pre-border-radius); + font-family: var(--ifm-font-family-monospace); font-weight: bold; - padding: 4px 12px; - border-bottom: 1px solid; + padding: var(--ifm-pre-padding); + border-bottom: 1px solid var(--ifm-color-emphasis-200); width: 100%; } @@ -28,10 +27,10 @@ } .copyButton { - background: rgb(1, 22, 39); - border: 1px solid rgb(214, 222, 235); + background: rgba(0, 0, 0, 0.3); + border: none; border-radius: var(--ifm-global-radius); - color: rgb(214, 222, 235); + color: var(--ifm-color-content); cursor: pointer; line-height: 12px; opacity: 0;