🚧 Change the code block style settings.
This commit is contained in:
parent
748c44e25d
commit
b9cd603c04
@ -1,6 +1,3 @@
|
|||||||
.highlight:hover .copy-btn, pre:hover .copy-btn {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.highlight {
|
.highlight {
|
||||||
|
|
||||||
@ -15,6 +12,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@if $codeblock_copy_btn_enable {
|
||||||
|
|
||||||
|
.highlight:hover .copy-btn, pre:hover .copy-btn {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
.copy-btn {
|
.copy-btn {
|
||||||
color: $black-dim;
|
color: $black-dim;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@ -27,12 +30,12 @@
|
|||||||
transition: opacity $transition-ease;
|
transition: opacity $transition-ease;
|
||||||
background: var(--highlight-background);
|
background: var(--highlight-background);
|
||||||
|
|
||||||
@if $codeblock_copy_btn_style == 'flat' {
|
@if $codeblock_style == 'flat' {
|
||||||
background: white;
|
background: white;
|
||||||
border: 0;
|
border: 0;
|
||||||
font-size: $font-size-smaller;
|
font-size: $font-size-smaller;
|
||||||
|
|
||||||
} @else if $codeblock_copy_btn_style == 'mac' {
|
} @else if $codeblock_style == 'mac' {
|
||||||
color: var(--highlight-foreground);
|
color: var(--highlight-foreground);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
@ -45,8 +48,9 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@if $codeblock_copy_btn_style == 'mac' {
|
@if $codeblock_style == 'mac' {
|
||||||
.highlight {
|
.highlight {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
|
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);
|
||||||
|
@ -52,7 +52,8 @@ $highlight_dark_foreground : #fff;
|
|||||||
$highlight_light_background : #565656;
|
$highlight_light_background : #565656;
|
||||||
$highlight_light_foreground : #fff;
|
$highlight_light_foreground : #fff;
|
||||||
|
|
||||||
$codeblock_copy_btn_style : {{ $P.codeblock.copyBtn.style }};
|
$codeblock_copy_btn_enable : {{ $P.codeblock.copyBtn }};
|
||||||
|
$codeblock_style : {{ $P.codeblock.style }};
|
||||||
|
|
||||||
// Sidebar
|
// Sidebar
|
||||||
$sidebar_offset : {{ $P.sidebar.offset }};
|
$sidebar_offset : {{ $P.sidebar.offset }};
|
||||||
@ -113,7 +114,9 @@ $reading_progress_reversed : {{ $P.readingProgress.reversed }};
|
|||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$math_mathjax_enable : {{ $P.math.mathjax.enable }};
|
$math_mathjax_enable : {{ $P.math.mathjax.enable }};
|
||||||
$related_posts_enable : {{ $P.relatedPosts.enable }};
|
// TODO
|
||||||
|
//$related_posts_enable : {{ $P.relatedPosts.enable }};
|
||||||
|
$related_posts_enable : false;
|
||||||
$pdf_enable : {{ $P.pdf.enable }};
|
$pdf_enable : {{ $P.pdf.enable }};
|
||||||
$pdf_height : {{ $P.pdf.height }};
|
$pdf_height : {{ $P.pdf.height }};
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ if (!window.NexT) window.NexT = {};
|
|||||||
"darkmode" : {{ .Site.Params.darkmode }},
|
"darkmode" : {{ .Site.Params.darkmode }},
|
||||||
"version" : "{{ .Site.Data.config.version }}",
|
"version" : "{{ .Site.Data.config.version }}",
|
||||||
"sidebar" : {{ .Site.Params.sidebar | jsonify }},
|
"sidebar" : {{ .Site.Params.sidebar | jsonify }},
|
||||||
"copycode" : {{ .Site.Params.codeblock.copyBtn | jsonify }},
|
"copybtn" : {{ .Site.Params.codeblock.copyBtn }},
|
||||||
"bookmark" : {{ .Site.Params.bookmark | jsonify }},
|
"bookmark" : {{ .Site.Params.bookmark | jsonify }},
|
||||||
"comments" : {{ .Site.Params.comments | jsonify }},
|
"comments" : {{ .Site.Params.comments | jsonify }},
|
||||||
"mediumzoom" : {{ .Site.Params.mediumzoom }},
|
"mediumzoom" : {{ .Site.Params.mediumzoom }},
|
||||||
|
@ -45,7 +45,7 @@ NexT.boot.refresh = function() {
|
|||||||
CONFIG.pangu && window.pangu.spacingPage();
|
CONFIG.pangu && window.pangu.spacingPage();
|
||||||
|
|
||||||
CONFIG.isPage && NexT.utils.replacePostCRLink();
|
CONFIG.isPage && NexT.utils.replacePostCRLink();
|
||||||
CONFIG.isPage && NexT.utils.registerCopyCode();
|
CONFIG.isPage && CONFIG.copybtn && NexT.utils.registerCopyCode();
|
||||||
NexT.utils.registerTabsTag();
|
NexT.utils.registerTabsTag();
|
||||||
/*NexT.utils.registerActiveMenuItem();
|
/*NexT.utils.registerActiveMenuItem();
|
||||||
NexT.utils.registerLangSelect();*/
|
NexT.utils.registerLangSelect();*/
|
||||||
|
@ -41,7 +41,7 @@ NexT.utils = {
|
|||||||
*/
|
*/
|
||||||
registerCopyCode: function() {
|
registerCopyCode: function() {
|
||||||
let figure = document.querySelectorAll('.highlight pre');
|
let figure = document.querySelectorAll('.highlight pre');
|
||||||
if (figure.length === 0 || !CONFIG.copycode) return;
|
if (figure.length === 0 || !CONFIG.copybtn) return;
|
||||||
figure.forEach(element => {
|
figure.forEach(element => {
|
||||||
let cn = element.querySelector('code').className;
|
let cn = element.querySelector('code').className;
|
||||||
// TODO seems hard code need find other ways fixed it.
|
// TODO seems hard code need find other ways fixed it.
|
||||||
|
Loading…
Reference in New Issue
Block a user