惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
CXSECURITY Database RSS Feed - CXSecurity.com
Help Net Security
Help Net Security
P
Privacy International News Feed
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tor Project blog
AWS News Blog
AWS News Blog
K
Kaspersky official blog
A
Arctic Wolf
Latest news
Latest news
T
Threat Research - Cisco Blogs
L
LINUX DO - 最新话题
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Google DeepMind News
Google DeepMind News
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
月光博客
月光博客
N
News and Events Feed by Topic
Jina AI
Jina AI
博客园 - 司徒正美
WordPress大学
WordPress大学
罗磊的独立博客
雷峰网
雷峰网
AI
AI
Hugging Face - Blog
Hugging Face - Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Security @ Cisco Blogs
博客园 - 三生石上(FineUI控件)
H
Heimdal Security Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cisco Blogs
博客园 - 【当耐特】
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Schneier on Security
Schneier on Security
博客园 - Franky
S
SegmentFault 最新的问题
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Cloudbric
Cloudbric
爱范儿
爱范儿
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Last Week in AI
Last Week in AI
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Know Your Adversary
Know Your Adversary
Google DeepMind News
Google DeepMind News

Hyde Blog

Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog 关于我 关于我 Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog
Hyde Blog
Hyde · 2025-10-05 · via Hyde Blog

代码块带标题 ​

创建 ​

  • Demo\docs-base\.vitepress\theme\style 目录新建一个 vp-code-title.scss 文件

    注意

    使用前,必须先安装 代码组图标 插件 才可以生效。推荐使用pmpm安装

pnpmyarnnpmbun

sh

cd Demo\docs-base
pnpm add -D vitepress-plugin-group-icons

sh

yarn add -D vitepress-plugin-group-icons

sh

npm install vitepress-plugin-group-icons

sh

bun add -D vitepress-plugin-group-icons

md

.
├─ demo
│ ├─ docs-base
│ │ ├─ .vitepress
│ │ │ └─ config.mts
│ │ │ └─ theme
│ │     └─ style
│ │       └─ index.scss
│ │       └─ vp-code-title.scss
│ └─ index.md
└─ node_modules

配置 ​

scss

/* Demo/docs-base/.vitepress/theme/style/vp-code-title.scss */
/* 整体容器样式(带阴影和圆角) */
.vp-code-block-title {
  background-color: var(--vp-code-block-bg);
  margin-bottom: 20px;
  border-radius: 8px;
  box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.4); /* 添加阴影 */
  overflow: hidden;
  position: relative; /* 确保小圆点定位 */
}

/* Mac 风格的小圆点,放在容器顶部 */
.vp-code-block-title::before {
  content: "";
  position: absolute;
  top: 12px; /* 圆点距离容器顶部的距离 */
  left: 12px;
  width: 12px;
  height: 12px;
  background-color: #fc625d; /* 红色圆点 */
  border-radius: 50%;
  box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b; /* 黄色和绿色圆点 */
  z-index: 1;
}

/* 标题栏样式 */
.vp-code-block-title .vp-code-block-title-bar {
  color: var(--vp-c-text-1);
  font-size: 14px;
  font-weight: bold;
}

/* 代码块标题:修正倒角、阴影、边距 */
.vp-code-block-title
  div[class*="language-"].vp-adaptive-theme.line-numbers-mode {
  border-radius: 8px;
  box-shadow: none;
  padding-top: 0px;
  margin-bottom: 0px;
}

/* 代码块标题:隐藏小圆点 */
.vp-code-block-title
  div[class*="language-"].vp-adaptive-theme.line-numbers-mode::before {
  display: none;
}

/* 代码块标题:修正行号位置 */
.vp-code-block-title .line-numbers-mode .line-numbers-wrapper {
  padding-top: 20px;
}

/* 代码块标题:修正行号右侧竖线位置 */
.vp-code-block-title .line-numbers-mode .line-numbers-wrapper::after {
  top: 20px;
  height: calc(100% - 40px);
}

/* 代码块标题(无行号):修正倒角、阴影、边距 */
.vp-code-block-title div[class*="language-"].vp-adaptive-theme {
  border-radius: 8px;
  box-shadow: none;
  padding-top: 0px;
}

/* 代码块标题(无行号):隐藏小圆点 */
.vp-code-block-title div[class*="language-"].vp-adaptive-theme::before {
  display: none;
}
  • Demo\docs-base\.vitepress\theme\style\文件中创建index.scss文件,并添加以下内容

scss

@use "./vp-code-title.scss" as *; //代码块标题

引入 ​

  • Demo\docs-base\.vitepress\theme\index.ts文件中引入以下内容

ts

// 引入Demo\docs-base\.vitepress\theme\style\index.scss全局样式
import "./style/index.scss";