/* 代码块容器基础样式 */
.code-toolbar {
position: relative;
margin: 1em 0;
background: #282c34;
border-radius: 6px;
padding-top: 40px;
box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px;
}
/* 工具栏显示控制 */
.code-toolbar:hover .toolbar {
opacity: 1;
}
/* 代码块基础样式 */
.code-toolbar pre {
margin: 0 !important;
border-radius: 6px;
}
/* 自定义滚动条 */
.code-toolbar pre::-webkit-scrollbar {
height: 8px;
background-color: #282c34;
}
.code-toolbar pre::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.3);
border-radius: 4px;
}
.code-toolbar pre::-webkit-scrollbar-thumb:hover {
background: rgba(255, 255, 255, 0.5);
}
/* 代码内容间距调整 */
.code-toolbar pre code {
padding: 0 10px 0 5px;
}
/* 行号样式 */
.linenums li {
padding: 0 !important;
}
/* Mac风格顶部栏 */
.code-toolbar:before {
content: '';
height: 40px;
width: 100%;
background: #21252b;
display: block;
position: absolute;
top: 0;
left: 0;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
/* Mac风格按钮 */
.code-toolbar:after {
content: '';
position: absolute;
top: 12px;
left: 20px;
width: 12px;
height: 12px;
border-radius: 50%;
background: #ff5f56;
box-shadow: 25px 0 0 #ffbd2e, 50px 0 0 #27c93f;
z-index: 1;
}
/* 复制按钮 */
.toolbar {
position: absolute;
top: 6px;
right: 10px;
z-index: 2;
opacity: 0;
transition: opacity 0.3s ease;
}
/* 移动端适配 */
@media (max-width: 768px) {
.toolbar {
opacity: 1;
display: block !important;
pointer-events: auto !important;
}
.wp-block-jetpack-markdown .code-toolbar .toolbar {
display: block !important;
visibility: visible !important;
opacity: 1 !important;
}
.toolbar-item button {
display: block !important;
pointer-events: auto !important;
}
}
/* 复制按钮样式 */
.toolbar-item button {
padding: 5px 10px;
color: #ccc;
cursor: pointer;
background: #0e78f9;
border-radius: 3px;
line-height: 1.4;
}
临时
当前链接:https://www.aioscn.com/918.html
文章标题:临时
文章版权:清源极客 (https://www.aioscn.com) 所发布的内容,部分为原创文章,转载请注明来源,网络转载文章如有侵权请联系我们!
本文最后更新发布于:2025年09月08日 14:13,某些文章具有时效性,若有错误或已失效,请在下方留言。













