代码块
This commit is contained in:
parent
9bdc745c1c
commit
b51c93c8b6
|
@ -0,0 +1,148 @@
|
|||
/*代码块*/
|
||||
[data-theme=light] {
|
||||
--rl-code-bar-shadow: 0 5px 10px 0 rgba(144, 164, 174, 0.4);
|
||||
}
|
||||
|
||||
[data-theme=dark] {
|
||||
--rl-code-bar-shadow: 0 0 6px 2px #272727;
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar {
|
||||
margin: 18px 0;
|
||||
overflow: hidden;
|
||||
-webkit-box-shadow: var(--rl-code-bar-shadow);
|
||||
box-shadow: var(--rl-code-bar-shadow);
|
||||
border-radius: 7px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: 12px;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background-color: #fc625d;
|
||||
-webkit-box-shadow: 20px 0 #fdbc40,40px 0 #35cd4b;
|
||||
box-shadow: 20px 0 #fdbc40,40px 0 #35cd4b
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
opacity: 1;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: unset;
|
||||
height: 35px;
|
||||
line-height: 32px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar-item:first-child {
|
||||
display: none
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar-item:first-child span {
|
||||
background-color: transparent;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
font-weight: 700;
|
||||
font-size: 0.9em;
|
||||
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
font-size: 1rem;
|
||||
right: 12px;
|
||||
color: #999;
|
||||
pointer-events: all
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item>i {
|
||||
margin-left: 10px;
|
||||
-webkit-transition: -webkit-transform .2s;
|
||||
transition: transform .2s;
|
||||
transition: transform .2s,-webkit-transform .2s
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item>i:hover {
|
||||
-webkit-filter: brightness(1.2);
|
||||
filter: brightness(1.2)
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-expander i.code-expander {
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(90deg)
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-title .toolbar-item:first-child {
|
||||
display: block
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-hr {
|
||||
border-bottom: 1px solid #b2a8a84d
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 35px 0 0;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
text-shadow: none;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] .line-numbers-rows {
|
||||
border-right: none;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
padding-top: 12px;
|
||||
width: 2.7em;
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-] {
|
||||
display: block;
|
||||
margin-bottom: 0;
|
||||
overflow-x: auto;
|
||||
padding: 5px 18px 10px;
|
||||
border-radius: 0 0 8px 8px;
|
||||
text-shadow: none
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-]::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-] .style .token.string,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.entity,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.operator,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.string,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.url {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-].line-numbers code[class*=language-] {
|
||||
padding: 10px 20px 10px 48px;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
.top-0 {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-].c-toggle{
|
||||
display: none;
|
||||
}
|
||||
/*代码块*/
|
|
@ -54,151 +54,4 @@ ul li {
|
|||
|
||||
|
||||
|
||||
/*代码块*/
|
||||
[data-theme=light] {
|
||||
--rl-code-bar-shadow: 0 5px 10px 0 rgba(144, 164, 174, 0.4);
|
||||
}
|
||||
|
||||
[data-theme=dark] {
|
||||
--rl-code-bar-shadow: 0 0 6px 2px #272727;
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar {
|
||||
margin: 18px 0;
|
||||
overflow: hidden;
|
||||
-webkit-box-shadow: var(--rl-code-bar-shadow);
|
||||
box-shadow: var(--rl-code-bar-shadow);
|
||||
border-radius: 7px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar:before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 11px;
|
||||
left: 12px;
|
||||
z-index: 1;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
border-radius: 50%;
|
||||
background-color: #fc625d;
|
||||
-webkit-box-shadow: 20px 0 #fdbc40,40px 0 #35cd4b;
|
||||
box-shadow: 20px 0 #fdbc40,40px 0 #35cd4b
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar {
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
opacity: 1;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: unset;
|
||||
height: 35px;
|
||||
line-height: 32px;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar-item:first-child {
|
||||
display: none
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar-item:first-child span {
|
||||
background-color: transparent;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
font-weight: 700;
|
||||
font-size: 0.9em;
|
||||
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none;
|
||||
font-size: 1rem;
|
||||
right: 12px;
|
||||
color: #999;
|
||||
pointer-events: all
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item>i {
|
||||
margin-left: 10px;
|
||||
-webkit-transition: -webkit-transform .2s;
|
||||
transition: transform .2s;
|
||||
transition: transform .2s,-webkit-transform .2s
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar .custom-item>i:hover {
|
||||
-webkit-filter: brightness(1.2);
|
||||
filter: brightness(1.2)
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-expander i.code-expander {
|
||||
-webkit-transform: rotate(90deg);
|
||||
transform: rotate(90deg)
|
||||
}
|
||||
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-title .toolbar-item:first-child {
|
||||
display: block
|
||||
}
|
||||
|
||||
#article-container .code-toolbar .toolbar.c-hr {
|
||||
border-bottom: 1px solid #b2a8a84d
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] {
|
||||
position: relative;
|
||||
margin: 0;
|
||||
padding: 35px 0 0;
|
||||
overflow: hidden;
|
||||
white-space: pre;
|
||||
text-shadow: none;
|
||||
border-radius: 5px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] .line-numbers-rows {
|
||||
border-right: none;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
padding-top: 12px;
|
||||
width: 2.7em;
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-] {
|
||||
display: block;
|
||||
margin-bottom: 0;
|
||||
overflow-x: auto;
|
||||
padding: 5px 18px 10px;
|
||||
border-radius: 0 0 8px 8px;
|
||||
text-shadow: none
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-]::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
height: 5px
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-] .style .token.string,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.entity,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.operator,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.string,#article-container .code-toolbar pre[class*=language-] code[class*=language-] .token.url {
|
||||
background-color: transparent
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-].line-numbers code[class*=language-] {
|
||||
padding: 10px 20px 10px 48px;
|
||||
}
|
||||
|
||||
.absolute {
|
||||
position: absolute;
|
||||
}
|
||||
.top-0 {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
#article-container .code-toolbar pre[class*=language-] code[class*=language-].c-toggle{
|
||||
display: none;
|
||||
}
|
||||
/*代码块*/
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
<th:block th:if="${theme.config.code.enable}">
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'"
|
||||
th:href="${assets_link+'/libs/prism/prism.min.css'}">
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'"
|
||||
th:href="${assets_link+'/libs/prism/code.css'}">
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'" data-code-theme="light"
|
||||
th:href="${assets_link+ '/libs/prism/themes/prism-'+theme.config.code.theme_light+'.css'}">
|
||||
<link rel="preload" as="style" onload="this.rel='stylesheet'" data-code-theme="dark"
|
||||
|
|
Loading…
Reference in New Issue