feat: 全局启用代码块复制按钮与语言标签功能
This commit is contained in:
parent
5e9220302c
commit
fdafeb736f
@ -55,10 +55,12 @@
|
|||||||
upgradeCodeBlocks();
|
upgradeCodeBlocks();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style is:global>
|
<style is:global>
|
||||||
/* 优化代码块圆角与阴影 */
|
/* 优化代码块圆角与阴影 */
|
||||||
pre {
|
pre {
|
||||||
@apply rounded-xl shadow-2xl border border-gray-800/50 !important;
|
border-radius: 0.75rem;
|
||||||
|
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
|
||||||
|
border: 1px solid rgba(55, 65, 81, 0.5);
|
||||||
}
|
}
|
||||||
/* 隐藏原有的滚动条,美化自定义滚动条 */
|
/* 隐藏原有的滚动条,美化自定义滚动条 */
|
||||||
pre::-webkit-scrollbar {
|
pre::-webkit-scrollbar {
|
||||||
@ -68,4 +70,4 @@
|
|||||||
background: #374151;
|
background: #374151;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
import '../styles/global.css';
|
import '../styles/global.css';
|
||||||
import Sidebar from '../components/Sidebar.astro';
|
import Sidebar from '../components/Sidebar.astro';
|
||||||
|
import CodeBlockHelper from '../components/CodeBlockHelper.astro';
|
||||||
const { title } = Astro.props;
|
const { title } = Astro.props;
|
||||||
---
|
---
|
||||||
<html lang="zh-CN">
|
<html lang="zh-CN">
|
||||||
@ -16,5 +17,6 @@ const { title } = Astro.props;
|
|||||||
<slot />
|
<slot />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
<CodeBlockHelper />
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user