From 56aea4b2abafcefaa0da3a6e5a897c4c7269fca1 Mon Sep 17 00:00:00 2001 From: Meow <197331664+Meo597@users.noreply.github.com> Date: Wed, 17 Dec 2025 12:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=9D=97=E5=92=8C=E5=AE=B9?= =?UTF-8?q?=E5=99=A8=E5=9D=97=E7=9A=84=E6=A0=B7=E5=BC=8F=E3=80=81=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=89=80=E6=9C=89=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vitepress/theme/index.mts | 2 + .vitepress/theme/style/blockquote.css | 9 ++ .vitepress/theme/style/custom-block.css | 177 ++++++++++++++++++++++++ .vitepress/theme/style/index.css | 3 + .vitepress/theme/style/var.css | 6 +- 5 files changed, 195 insertions(+), 2 deletions(-) create mode 100644 .vitepress/theme/style/blockquote.css create mode 100644 .vitepress/theme/style/custom-block.css create mode 100644 .vitepress/theme/style/index.css diff --git a/.vitepress/theme/index.mts b/.vitepress/theme/index.mts index b94e18c1..a57bda33 100644 --- a/.vitepress/theme/index.mts +++ b/.vitepress/theme/index.mts @@ -2,6 +2,8 @@ import DefaultTheme from "vitepress/theme"; +import "./style/index.css"; + import mediumZoom from "medium-zoom"; import { onMounted, watch, nextTick } from "vue"; import { useRoute } from "vitepress"; diff --git a/.vitepress/theme/style/blockquote.css b/.vitepress/theme/style/blockquote.css new file mode 100644 index 00000000..1de9ea00 --- /dev/null +++ b/.vitepress/theme/style/blockquote.css @@ -0,0 +1,9 @@ +/* .vitepress/theme/style/blockquote.css */ + +.vp-doc blockquote { + border-radius: 10px; + padding: 18px 20px 20px 15px; + position: relative; + background-color: var(--vp-c-gray-soft); + border-left: 6px solid var(--vp-c-green-2); +} diff --git a/.vitepress/theme/style/custom-block.css b/.vitepress/theme/style/custom-block.css new file mode 100644 index 00000000..b5586d1f --- /dev/null +++ b/.vitepress/theme/style/custom-block.css @@ -0,0 +1,177 @@ +/* .vitepress/theme/style/custom-block.css */ + +:root { + --custom-block-info-left: #cccccc; + --custom-block-info-bg: #fafafa; + + --custom-block-tip-left: #009400; + --custom-block-tip-bg: #e6f6e6; + + --custom-block-warning-left: #e6a700; + --custom-block-warning-bg: #fff8e6; + + --custom-block-danger-left: #e13238; + --custom-block-danger-bg: #ffebec; + + --custom-block-note-left: #4cb3d4; + --custom-block-note-bg: #eef9fd; + + --custom-block-important-left: #a371f7; + --custom-block-important-bg: #f4eefe; + + --custom-block-caution-left: #e0575b; + --custom-block-caution-bg: #fde4e8; +} + +.dark { + --custom-block-info-left: #cccccc; + --custom-block-info-bg: #474748; + + --custom-block-tip-left: #009400; + --custom-block-tip-bg: #003100; + + --custom-block-warning-left: #e6a700; + --custom-block-warning-bg: #4d3800; + + --custom-block-danger-left: #e13238; + --custom-block-danger-bg: #4b1113; + + --custom-block-note-left: #4cb3d4; + --custom-block-note-bg: #193c47; + + --custom-block-important-left: #a371f7; + --custom-block-important-bg: #230555; + + --custom-block-caution-left: #e0575b; + --custom-block-caution-bg: #391c22; +} + +.custom-block-title { + font-size: 16px; +} + +.custom-block.info { + border-left: 5px solid var(--custom-block-info-left); + background-color: var(--custom-block-info-bg); +} + +.custom-block.info [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-11v6h2v-6h-2zm0-4v2h2V7h-2z' fill='%23ccc'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -1px; +} + +.custom-block.tip { + /* border-color: var(--custom-block-tip); */ + border-left: 5px solid var(--custom-block-tip-left); + background-color: var(--custom-block-tip-bg); +} + +.custom-block.tip [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23009400' d='M7.941 18c-.297-1.273-1.637-2.314-2.187-3a8 8 0 1 1 12.49.002c-.55.685-1.888 1.726-2.185 2.998H7.94zM16 20v1a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-1h8zm-3-9.995V6l-4.5 6.005H11v4l4.5-6H13z'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -2px; +} + +.custom-block.warning { + border-left: 5px solid var(--custom-block-warning-left); + background-color: var(--custom-block-warning-bg); +} + +.custom-block.warning [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M576.286 752.57v-95.425q0-7.031-4.771-11.802t-11.3-4.772h-96.43q-6.528 0-11.3 4.772t-4.77 11.802v95.424q0 7.031 4.77 11.803t11.3 4.77h96.43q6.528 0 11.3-4.77t4.77-11.803zm-1.005-187.836 9.04-230.524q0-6.027-5.022-9.543-6.529-5.524-12.053-5.524H456.754q-5.524 0-12.053 5.524-5.022 3.516-5.022 10.547l8.538 229.52q0 5.023 5.022 8.287t12.053 3.265h92.913q7.032 0 11.803-3.265t5.273-8.287zM568.25 95.65l385.714 707.142q17.578 31.641-1.004 63.282-8.538 14.564-23.354 23.102t-31.892 8.538H126.286q-17.076 0-31.892-8.538T71.04 866.074q-18.582-31.641-1.004-63.282L455.75 95.65q8.538-15.57 23.605-24.61T512 62t32.645 9.04 23.605 24.61z' fill='%23e6a700'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; +} + +.custom-block.danger { + border-left: 5px solid var(--custom-block-danger-left); + background-color: var(--custom-block-danger-bg); +} + +.custom-block.danger [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c5.523 0 10 4.477 10 10v3.764a2 2 0 0 1-1.106 1.789L18 19v1a3 3 0 0 1-2.824 2.995L14.95 23a2.5 2.5 0 0 0 .044-.33L15 22.5V22a2 2 0 0 0-1.85-1.995L13 20h-2a2 2 0 0 0-1.995 1.85L9 22v.5c0 .171.017.339.05.5H9a3 3 0 0 1-3-3v-1l-2.894-1.447A2 2 0 0 1 2 15.763V12C2 6.477 6.477 2 12 2zm-4 9a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4z' fill='%23e13238'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -1px; +} + +.custom-block.note { + border-left: 5px solid var(--custom-block-note-left); + background-color: var(--custom-block-note-bg); +} + +.custom-block.note [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-11v6h2v-6h-2zm0-4v2h2V7h-2z' fill='%234cb3d4'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -1px; +} + +.custom-block.important { + border-left: 5px solid var(--custom-block-important-left); + background-color: var(--custom-block-important-bg); +} + +.custom-block.important [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024'%3E%3Cpath d='M512 981.333a84.992 84.992 0 0 1-84.907-84.906h169.814A84.992 84.992 0 0 1 512 981.333zm384-128H128v-42.666l85.333-85.334v-256A298.325 298.325 0 0 1 448 177.92V128a64 64 0 0 1 128 0v49.92a298.325 298.325 0 0 1 234.667 291.413v256L896 810.667v42.666zm-426.667-256v85.334h85.334v-85.334h-85.334zm0-256V512h85.334V341.333h-85.334z' fill='%23a371f7'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -1px; +} + +.custom-block.caution { + border-left: 5px solid var(--custom-block-caution-left); + background-color: var(--custom-block-caution-bg); +} + +.custom-block.caution [class*="custom-block-title"]::before { + content: ""; + background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2c5.523 0 10 4.477 10 10v3.764a2 2 0 0 1-1.106 1.789L18 19v1a3 3 0 0 1-2.824 2.995L14.95 23a2.5 2.5 0 0 0 .044-.33L15 22.5V22a2 2 0 0 0-1.85-1.995L13 20h-2a2 2 0 0 0-1.995 1.85L9 22v.5c0 .171.017.339.05.5H9a3 3 0 0 1-3-3v-1l-2.894-1.447A2 2 0 0 1 2 15.763V12C2 6.477 6.477 2 12 2zm-4 9a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm8 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4z' fill='%23e13238'/%3E%3C/svg%3E"); + width: 20px; + height: 20px; + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 4px; + left: -5px; + top: -1px; +} diff --git a/.vitepress/theme/style/index.css b/.vitepress/theme/style/index.css new file mode 100644 index 00000000..346c3319 --- /dev/null +++ b/.vitepress/theme/style/index.css @@ -0,0 +1,3 @@ +@import "./var.css"; +@import "./custom-block.css"; +@import "./blockquote.css"; diff --git a/.vitepress/theme/style/var.css b/.vitepress/theme/style/var.css index d77be431..66dda8e3 100644 --- a/.vitepress/theme/style/var.css +++ b/.vitepress/theme/style/var.css @@ -1,7 +1,9 @@ +/* .vitepress/theme/style/var.css */ + .medium-zoom-overlay { - z-index: 30; + z-index: 30; } .medium-zoom-image { - z-index: 9999 !important; + z-index: 9999 !important; }