This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository
https://gitbox.apache.org/repos/asf/incubator-streampark-website.git
The following commit(s) were added to refs/heads/dev by this push:
new 8f109728 [Improve] code block style on light theme (#394)
8f109728 is described below
commit 8f109728c89fabbff0ee3b68a5b40688b87bd913
Author: fengweixin <[email protected]>
AuthorDate: Tue Jul 9 00:33:17 2024 +0800
[Improve] code block style on light theme (#394)
---
docusaurus.config.js | 4 +++-
src/css/custom/default.less | 4 ++--
src/css/custom/index.less | 4 ++++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 3481e432..391cf3e0 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -19,6 +19,8 @@
const path = require('path')
// TODO: [remove] 代码块只用dark主题
const darkTheme = require('prism-react-renderer/themes/vsDark')
+const lightTheme = require('prism-react-renderer/themes/vsLight');
+
/** @type {import('@docusaurus/types').Config} */
const config = {
@@ -287,7 +289,7 @@ const config = {
},
prism: {
- theme: darkTheme,
+ theme: lightTheme,
darkTheme: darkTheme,
additionalLanguages: ['powershell', 'java', 'scala', 'yaml'],
magicComments: [
diff --git a/src/css/custom/default.less b/src/css/custom/default.less
index 2e7f8448..e6853a12 100644
--- a/src/css/custom/default.less
+++ b/src/css/custom/default.less
@@ -84,7 +84,7 @@
--ifm-table-border-color: var(--click-color-table-cell-stroke);
- --prism-background-color: var(--click-color-codeblock-background);
+ --prism-background-color: #f8f9fa;
--prism-color: var(--click-color-codeblock-button-text);
--ifm-tabs-color: var(--click-color-text-muted);
@@ -155,7 +155,7 @@
--docusaurus-highlighted-code-line-bg: rgba(255, 255, 255, 0.2);
--ifm-menu-link-sublist-icon: url("data:image/svg+xml,%3Csvg width='24'
height='24' viewBox='0 0 24 24' fill='none'
xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11.9988 9.21211L16.2363
13.4684L15.4488 14.2559L11.9988 10.8059L8.54883 14.2559L7.76133 13.4684L11.9988
9.21211Z' fill='%23E2E3E7' /%3E%3Cpath d='M11.9988 9.21211L16.2363
13.4684L15.4488 14.2559L11.9988 10.8059L8.54883 14.2559L7.76133 13.4684L11.9988
9.21211Z' fill='black' fill-opacity='0.2'/%3E%3C/svg%3E");
-
+ --prism-background-color: var(--click-color-codeblock-background);
/* navbar 配置 */
--ifm-navbar-background-color: #242526;
diff --git a/src/css/custom/index.less b/src/css/custom/index.less
index 70a2ddfc..a62803cd 100644
--- a/src/css/custom/index.less
+++ b/src/css/custom/index.less
@@ -159,6 +159,10 @@ article[itemprop="blogPost"] {
display: block !important;
}
+pre code {
+ background: var(--ifm-code-background);
+}
+
code {
border: none;
word-break: normal;