add more customization options for code block, code block style bug fixed
This commit is contained in:
parent
ff9d1a6b92
commit
05ce96a3ba
|
@ -45,7 +45,7 @@
|
||||||
margin-bottom: 0.5rem;
|
margin-bottom: 0.5rem;
|
||||||
padding-bottom: 0.5rem;
|
padding-bottom: 0.5rem;
|
||||||
|
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
text-decoration: underline double themed('content-pre-main-color');
|
text-decoration: underline double themed('content-pre-main-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,12 @@ $theme_hacker_chroma: {{ .Site.Data.skin.theme_hacker_chroma }};
|
||||||
$theme_solarized_chroma: {{ .Site.Data.skin.theme_solarized_chroma }};
|
$theme_solarized_chroma: {{ .Site.Data.skin.theme_solarized_chroma }};
|
||||||
$theme_custom_chroma: {{ .Site.Data.skin.theme_custom_chroma }};
|
$theme_custom_chroma: {{ .Site.Data.skin.theme_custom_chroma }};
|
||||||
|
|
||||||
|
$theme_light_chroma_background: {{ .Site.Data.skin.theme_light_chroma_background }};
|
||||||
|
$theme_dark_chroma_background: {{ .Site.Data.skin.theme_dark_chroma_background }};
|
||||||
|
$theme_hacker_chroma_background: {{ .Site.Data.skin.theme_hacker_chroma_background }};
|
||||||
|
$theme_solarized_chroma_background: {{ .Site.Data.skin.theme_solarized_chroma_background }};
|
||||||
|
$theme_custom_chroma_background: {{ .Site.Data.skin.theme_custom_chroma_background }};
|
||||||
|
|
||||||
$title-font: {{ .Site.Data.font.title_font }};
|
$title-font: {{ .Site.Data.font.title_font }};
|
||||||
$content-font: {{ .Site.Data.font.content_font }};
|
$content-font: {{ .Site.Data.font.content_font }};
|
||||||
|
|
||||||
|
|
|
@ -114,28 +114,52 @@
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
padding: 34px 12px 8px;
|
padding: 34px 12px 8px;
|
||||||
position: relative;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 0.34rem;
|
border-radius: 0.34rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre:not(.chroma) {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.chroma {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
&::after {
|
@include on-event {
|
||||||
|
.copy-to-clipboard {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pre > code:not([class^=language]) {
|
||||||
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
|
||||||
left: 0;
|
left: 0;
|
||||||
|
padding: 2px 7px;
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
z-index: 1;
|
||||||
|
line-height: 30px;
|
||||||
font-size: $code-font-size;
|
font-size: $code-font-size;
|
||||||
font-family: $title-font;
|
font-family: $title-font;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
content: attr(data-lang);
|
display: inline-block;
|
||||||
|
text-transform: capitalize;
|
||||||
|
content: 'Code';
|
||||||
|
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
color: themed('content-pre-header-color');
|
color: themed('content-pre-header-color');
|
||||||
background: themed('content-pre-header-background-color');
|
background: themed('content-pre-header-background-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p > code {
|
||||||
|
padding: 0.25rem 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
code + .copy-to-clipboard {
|
code + .copy-to-clipboard {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 4px;
|
right: 4px;
|
||||||
|
@ -146,20 +170,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-to-clipboard {
|
.copy-to-clipboard {
|
||||||
@include clippy();
|
|
||||||
background-position: 50% 50%;
|
background-position: 50% 50%;
|
||||||
background-size: 16px 16px;
|
background-size: 16px 16px;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
width: 27px;
|
width: 27px;
|
||||||
height: 1.45rem;
|
height: 1.45rem;
|
||||||
top: -1px;
|
top: -1px;
|
||||||
display: inline-block;
|
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: -0.2rem;
|
margin-left: -0.2rem;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
border-radius: 0 2px 2px 0;
|
border-radius: 0 2px 2px 0;
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
|
opacity: 0;
|
||||||
|
|
||||||
|
@include clippy();
|
||||||
@include transition(all, 0.2s, ease);
|
@include transition(all, 0.2s, ease);
|
||||||
}
|
}
|
||||||
.copy-to-clipboard:hover {
|
.copy-to-clipboard:hover {
|
||||||
|
@ -280,7 +305,7 @@
|
||||||
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.125);
|
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.125);
|
||||||
|
|
||||||
|
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
thead {
|
thead {
|
||||||
background: themed('content-pre-header-background-color');
|
background: themed('content-pre-header-background-color');
|
||||||
}
|
}
|
||||||
|
@ -325,7 +350,6 @@ code, pre {
|
||||||
line-height: 1.4;
|
line-height: 1.4;
|
||||||
font-size: $code-font-size;
|
font-size: $code-font-size;
|
||||||
font-family: $code-font-stack;
|
font-family: $code-font-stack;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
a {
|
a {
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
|
@ -334,10 +358,14 @@ code, pre {
|
||||||
|
|
||||||
*:not(.chroma) {
|
*:not(.chroma) {
|
||||||
code, pre {
|
code, pre {
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
background: themed('content-pre-background-color');
|
background: themed('content-pre-background-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
|
@ -354,60 +382,70 @@ pre:not(.chroma) {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
|
|
||||||
|
@include on-event {
|
||||||
|
.copy-to-clipboard {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
padding: 2px 7px;
|
padding: 2px 7px;
|
||||||
font-size: $code-font-size;
|
width: 100%;
|
||||||
font-family: $title-font;
|
height: 30px;
|
||||||
font-weight: bold;
|
z-index: 0;
|
||||||
border-top-left-radius: 0.25rem;
|
border-top-left-radius: 0.25rem;
|
||||||
border-top-right-radius: 0.25rem;
|
border-top-right-radius: 0.25rem;
|
||||||
content: attr(data-lang);
|
content: '';
|
||||||
|
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
color: themed('content-pre-header-color');
|
color: themed('content-pre-header-color');
|
||||||
background: themed('content-pre-header-background-color');
|
background: themed('content-pre-header-background-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
|
||||||
padding: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight > .chroma {
|
.highlight > .chroma {
|
||||||
margin: 1em 0;
|
margin: 1em 0;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
|
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
|
||||||
position: relative;
|
z-index: 1;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
|
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
color: themed('content-pre-color');
|
color: themed('content-pre-color');
|
||||||
background: themed('content-pre-background-color');
|
background: themed('content-pre-background-color');
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code[data-lang] {
|
||||||
|
&::before {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 2;
|
||||||
|
padding: 2px 7px;
|
||||||
|
width: 100%;
|
||||||
|
height: 30px;
|
||||||
|
line-height: 30px;
|
||||||
|
font-size: $code-font-size;
|
||||||
|
font-family: $title-font;
|
||||||
|
font-weight: bold;
|
||||||
|
display: inline-block;
|
||||||
|
text-transform: capitalize;
|
||||||
|
content: attr(data-lang);
|
||||||
|
|
||||||
&::after {
|
@include themify($codeblock) {
|
||||||
position: absolute;
|
color: themed('content-pre-header-color');
|
||||||
top: 0;
|
background: themed('content-pre-header-background-color');
|
||||||
right: 0;
|
}
|
||||||
left: 0;
|
|
||||||
padding: 2px 7px;
|
|
||||||
font-size: $code-font-size;
|
|
||||||
font-family: $title-font;
|
|
||||||
font-weight: bold;
|
|
||||||
@include themify($themes) {
|
|
||||||
color: themed('content-pre-header-color');
|
|
||||||
background: themed('content-pre-header-background-color');
|
|
||||||
}
|
}
|
||||||
content: attr(data-lang);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.lntd {
|
.lntd {
|
||||||
|
@ -426,7 +464,6 @@ pre:not(.chroma) {
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
position: relative;
|
|
||||||
|
|
||||||
pre {
|
pre {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
@ -444,7 +481,7 @@ pre:not(.chroma) {
|
||||||
|
|
||||||
/* LineNumbersTable */
|
/* LineNumbersTable */
|
||||||
.lnt {
|
.lnt {
|
||||||
@include themify($themes) {
|
@include themify($codeblock) {
|
||||||
color: themed('content-pre-number-color');
|
color: themed('content-pre-number-color');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,15 +46,8 @@ $custom: (
|
||||||
single-contents-title-color: hsl($custom_theme_primary_color, 70%, 22%),
|
single-contents-title-color: hsl($custom_theme_primary_color, 70%, 22%),
|
||||||
related-header-title-color: hsl($custom_theme_primary_color, 100%, 10%),
|
related-header-title-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
related-link-color: hsl($custom_theme_primary_color, 65%, 32%),
|
related-link-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
content-box-border-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
content-box-background-color: hsl($custom_theme_primary_color, 100%, 94%),
|
||||||
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
|
||||||
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
|
||||||
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
|
||||||
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
|
||||||
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
|
||||||
content-box-border-color: #ff0000,
|
|
||||||
content-box-background-color: #ff0000,
|
|
||||||
burger-menu-color: hsl($custom_theme_primary_color, 86%, 20%),
|
burger-menu-color: hsl($custom_theme_primary_color, 86%, 20%),
|
||||||
social-icon-color: hsl($custom_theme_primary_color, 25%, 35%),
|
social-icon-color: hsl($custom_theme_primary_color, 25%, 35%),
|
||||||
social-icon-hover-color: hsl($custom_theme_primary_color, 25%, 50%),
|
social-icon-hover-color: hsl($custom_theme_primary_color, 25%, 50%),
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
$customcode: '';
|
||||||
|
|
||||||
|
@if $theme_custom_chroma_background == dark {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
} @else if $theme_custom_chroma_background == light {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_custom_chroma_background == hacker {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
} @else if $theme_custom_chroma_background == solarized {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: #B58900,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #faf1cd,
|
||||||
|
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
||||||
|
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_custom_chroma_background == custom {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
} @else {
|
||||||
|
$customcode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
}
|
|
@ -46,13 +46,6 @@ $dark: (
|
||||||
single-contents-title-color: #aed581,
|
single-contents-title-color: #aed581,
|
||||||
related-header-title-color: #FCFCFA,
|
related-header-title-color: #FCFCFA,
|
||||||
related-link-color: #A9DC76,
|
related-link-color: #A9DC76,
|
||||||
content-pre-main-color: #FFA7C4,
|
|
||||||
content-pre-color: #eee,
|
|
||||||
content-pre-number-color: #666,
|
|
||||||
content-pre-background-color: #171f2e,
|
|
||||||
content-pre-header-background-color: darken(#011627, 1.5%),
|
|
||||||
content-pre-border-background-color: #3a3a3a,
|
|
||||||
content-pre-header-color: #FCFCFA,
|
|
||||||
content-box-border-color: #616161,
|
content-box-border-color: #616161,
|
||||||
content-box-background-color: #403E41,
|
content-box-background-color: #403E41,
|
||||||
burger-menu-color: #FCFCFA,
|
burger-menu-color: #FCFCFA,
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
$darkcode: '';
|
||||||
|
|
||||||
|
@if $theme_dark_chroma_background == dark {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
} @else if $theme_dark_chroma_background == light {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_dark_chroma_background == hacker {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
} @else if $theme_dark_chroma_background == solarized {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: #B58900,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #faf1cd,
|
||||||
|
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
||||||
|
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_dark_chroma_background == custom {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
} @else {
|
||||||
|
$darkcode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
}
|
|
@ -46,13 +46,6 @@ $hacker: (
|
||||||
single-contents-title-color: #A1AD64,
|
single-contents-title-color: #A1AD64,
|
||||||
related-header-title-color: #FCFCFA,
|
related-header-title-color: #FCFCFA,
|
||||||
related-link-color: #C7BA00,
|
related-link-color: #C7BA00,
|
||||||
content-pre-main-color: #1FFF2A,
|
|
||||||
content-pre-color: #d1d1d1,
|
|
||||||
content-pre-number-color: #666,
|
|
||||||
content-pre-background-color: #282a36,
|
|
||||||
content-pre-border-background-color: #f3ff6e,
|
|
||||||
content-pre-header-background-color: darken(#202420, 1.5%),
|
|
||||||
content-pre-header-color: #f3ff6e,
|
|
||||||
content-box-border-color: #dbdbdb,
|
content-box-border-color: #dbdbdb,
|
||||||
content-box-background-color: #202420,
|
content-box-background-color: #202420,
|
||||||
burger-menu-color: #dbdbdb,
|
burger-menu-color: #dbdbdb,
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
$hackercode: '';
|
||||||
|
|
||||||
|
@if $theme_hacker_chroma_background == dark {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
} @else if $theme_hacker_chroma_background == light {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_hacker_chroma_background == hacker {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
} @else if $theme_hacker_chroma_background == solarized {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: #B58900,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #faf1cd,
|
||||||
|
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
||||||
|
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_hacker_chroma_background == custom {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
} @else {
|
||||||
|
$hackercode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
}
|
|
@ -45,14 +45,7 @@ $light: (
|
||||||
single-header-title-color: #424242,
|
single-header-title-color: #424242,
|
||||||
single-contents-title-color: #607d8b,
|
single-contents-title-color: #607d8b,
|
||||||
related-header-title-color: #424242,
|
related-header-title-color: #424242,
|
||||||
related-link-color: #607d8b,
|
related-link-color: #607d8b,
|
||||||
content-pre-main-color: #607d8b,
|
|
||||||
content-pre-color: #344952,
|
|
||||||
content-pre-number-color: #aaa,
|
|
||||||
content-pre-background-color: #F5F2F0,
|
|
||||||
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
|
||||||
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
|
||||||
content-pre-header-color: #344952,
|
|
||||||
content-box-border-color: #aaa,
|
content-box-border-color: #aaa,
|
||||||
content-box-background-color: #eeeeee,
|
content-box-background-color: #eeeeee,
|
||||||
burger-menu-color: #777,
|
burger-menu-color: #777,
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
$lightcode: '';
|
||||||
|
|
||||||
|
@if $theme_light_chroma_background == dark {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
} @else if $theme_light_chroma_background == light {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_light_chroma_background == hacker {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
} @else if $theme_light_chroma_background == solarized {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: #B58900,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #faf1cd,
|
||||||
|
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
||||||
|
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_light_chroma_background == custom {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
} @else {
|
||||||
|
$lightcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
}
|
|
@ -45,14 +45,7 @@ $solarized: (
|
||||||
single-header-title-color: #424242,
|
single-header-title-color: #424242,
|
||||||
single-contents-title-color: #B58900,
|
single-contents-title-color: #B58900,
|
||||||
related-header-title-color: #424242,
|
related-header-title-color: #424242,
|
||||||
related-link-color: #ffb300,
|
related-link-color: #ffb300,
|
||||||
content-pre-main-color: #B58900,
|
|
||||||
content-pre-color: #344952,
|
|
||||||
content-pre-number-color: #aaa,
|
|
||||||
content-pre-background-color: #faf1cd,
|
|
||||||
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
|
||||||
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
|
||||||
content-pre-header-color: #344952,
|
|
||||||
content-box-border-color: #B58900,
|
content-box-border-color: #B58900,
|
||||||
content-box-background-color: #FBF1D1,
|
content-box-background-color: #FBF1D1,
|
||||||
burger-menu-color: #B58900,
|
burger-menu-color: #B58900,
|
||||||
|
|
|
@ -0,0 +1,63 @@
|
||||||
|
$solarizedcode: '';
|
||||||
|
|
||||||
|
@if $theme_solarized_chroma_background == dark {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: #FFA7C4,
|
||||||
|
content-pre-color: #eee,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #171f2e,
|
||||||
|
content-pre-header-background-color: darken(#011627, 1.5%),
|
||||||
|
content-pre-border-background-color: #3a3a3a,
|
||||||
|
content-pre-header-color: #FCFCFA,
|
||||||
|
);
|
||||||
|
} @else if $theme_solarized_chroma_background == light {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_solarized_chroma_background == hacker {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: #1FFF2A,
|
||||||
|
content-pre-color: #d1d1d1,
|
||||||
|
content-pre-number-color: #666,
|
||||||
|
content-pre-background-color: #282a36,
|
||||||
|
content-pre-border-background-color: #f3ff6e,
|
||||||
|
content-pre-header-background-color: darken(#202420, 1.5%),
|
||||||
|
content-pre-header-color: #f3ff6e,
|
||||||
|
);
|
||||||
|
} @else if $theme_solarized_chroma_background == solarized {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: #B58900,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #faf1cd,
|
||||||
|
content-pre-border-background-color: darken(#FBF1D1, 12%),
|
||||||
|
content-pre-header-background-color: darken(#FBF1D1, 6%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
} @else if $theme_solarized_chroma_background == custom {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: hsl($custom_theme_primary_color, 65%, 32%),
|
||||||
|
content-pre-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-number-color: hsl($custom_theme_primary_color, 0%, 67%),
|
||||||
|
content-pre-background-color: hsl($custom_theme_primary_color, 100%, 97%),
|
||||||
|
content-pre-header-color: hsl($custom_theme_primary_color, 100%, 10%),
|
||||||
|
content-pre-header-background-color: hsl($custom_theme_primary_color, 100%, 92%),
|
||||||
|
content-pre-border-background-color: hsl($custom_theme_primary_color, 100%, 86%),
|
||||||
|
);
|
||||||
|
} @else {
|
||||||
|
$solarizedcode: (
|
||||||
|
content-pre-main-color: #607d8b,
|
||||||
|
content-pre-color: #344952,
|
||||||
|
content-pre-number-color: #aaa,
|
||||||
|
content-pre-background-color: #F5F2F0,
|
||||||
|
content-pre-border-background-color: darken(#F5F2F0, 7%),
|
||||||
|
content-pre-header-background-color: darken(#F5F2F0, 3%),
|
||||||
|
content-pre-header-color: #344952,
|
||||||
|
);
|
||||||
|
}
|
|
@ -4,10 +4,24 @@
|
||||||
@import 'solarized';
|
@import 'solarized';
|
||||||
@import 'custom';
|
@import 'custom';
|
||||||
|
|
||||||
|
@import 'darkcode';
|
||||||
|
@import 'lightcode';
|
||||||
|
@import 'hackercode';
|
||||||
|
@import 'solarizedcode';
|
||||||
|
@import 'customcode';
|
||||||
|
|
||||||
$themes: (
|
$themes: (
|
||||||
dark: $dark,
|
dark: $dark,
|
||||||
light: $light,
|
light: $light,
|
||||||
hacker: $hacker,
|
hacker: $hacker,
|
||||||
solarized: $solarized,
|
solarized: $solarized,
|
||||||
custom: $custom,
|
custom: $custom,
|
||||||
|
);
|
||||||
|
|
||||||
|
$codeblock: (
|
||||||
|
dark: $darkcode,
|
||||||
|
light: $lightcode,
|
||||||
|
hacker: $hackercode,
|
||||||
|
solarized: $solarizedcode,
|
||||||
|
custom: $customcode,
|
||||||
);
|
);
|
|
@ -6,4 +6,12 @@ theme_light_chroma = "default"
|
||||||
theme_dark_chroma = "default"
|
theme_dark_chroma = "default"
|
||||||
theme_hacker_chroma = "default"
|
theme_hacker_chroma = "default"
|
||||||
theme_solarized_chroma = "default"
|
theme_solarized_chroma = "default"
|
||||||
theme_custom_chroma = "default"
|
theme_custom_chroma = "default"
|
||||||
|
|
||||||
|
# possible value: default, dark, light, hacker, solarized, custom
|
||||||
|
# restart hugo after change this value
|
||||||
|
theme_light_chroma_background = "default"
|
||||||
|
theme_dark_chroma_background = "default"
|
||||||
|
theme_hacker_chroma_background = "default"
|
||||||
|
theme_solarized_chroma_background = "default"
|
||||||
|
theme_custom_chroma_background = "default"
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
<div class="single__infos">
|
<div class="single__infos">
|
||||||
<span title="{{ i18n "tooltip-written" }}">🕓 {{ .Date.Format (i18n "single-dateformat") }} </span> {{ if .GitInfo }} <span class="single__info" title="{{ i18n "tooltip-modified" }}"> 📝 {{ .Lastmod.Format (i18n "single-dateformat") }} </span> {{ end }} · <span class="single__info" title="{{ i18n "tooltip-reading-time" }}"> ☕ {{ .ReadingTime }} {{ i18n "reading-time" }} </span>
|
<span class="single__info" title="{{ i18n "tooltip-written" }}">🕓{{ .Date.Format (i18n "single-dateformat") }} </span> {{ if .GitInfo }} <span class="single__info" title="{{ i18n "tooltip-modified" }}"> 📝{{ .Lastmod.Format (i18n "single-dateformat") }} </span> {{ end }} · <span class="single__info" title="{{ i18n "tooltip-reading-time" }}"> ☕{{ .ReadingTime }} {{ i18n "reading-time" }} </span>
|
||||||
<span class="single__info">
|
<span class="single__info">
|
||||||
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} · 👀<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
|
{{ if (and .Site.Params.enableBusuanzi .Site.Params.busuanziPagePV) }} · 👀<span id="busuanzi_value_page_pv">...</span> {{ i18n "counter-page-pv" }}{{ end }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
|
@ -15,7 +15,7 @@
|
||||||
{{ $rightString := replace (index (split $.Site.Copyright "{}") 1) "{year}" now.Year }}
|
{{ $rightString := replace (index (split $.Site.Copyright "{}") 1) "{year}" now.Year }}
|
||||||
|
|
||||||
{{ if and ($.Site.Params.copyrightOptions.copyrightLinkImage) ($.Site.Params.copyrightOptions.copyrightLinkText) }}
|
{{ if and ($.Site.Params.copyrightOptions.copyrightLinkImage) ($.Site.Params.copyrightOptions.copyrightLinkText) }}
|
||||||
<a rel="license" href="{{ $.Site.Params.copyrightOptions.copyrightLink }}" class="footer__copyright--img"><img alt="{{ $.Site.Params.copyrightOptions.copyrightLinkText }}" style="border-width:0" src="{{ $.Site.Params.copyrightOptions.copyrightLinkImage }}"/></a>{{ $leftString }}{{ $rightString }}
|
<a rel="license" href="{{ $.Site.Params.copyrightOptions.copyrightLink }}" class="footer__copyright--img"><img alt="{{ $.Site.Params.copyrightOptions.copyrightLinkText }}" style="border-width:0" src="{{ $.Site.Params.copyrightOptions.copyrightLinkImage }}"/></a>{{ $leftString }}<a rel="license" href="{{ $.Site.Params.copyrightOptions.copyrightLink }}">{{ $.Site.Params.copyrightOptions.copyrightLinkText }}</a>{{ $rightString }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $leftString }}<a rel="license" href="{{ $.Site.Params.copyrightOptions.copyrightLink }}">{{ $.Site.Params.copyrightOptions.copyrightLinkText }}</a>{{ $rightString }}
|
{{ $leftString }}<a rel="license" href="{{ $.Site.Params.copyrightOptions.copyrightLink }}">{{ $.Site.Params.copyrightOptions.copyrightLinkText }}</a>{{ $rightString }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -72,18 +72,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
// syntax highlight
|
|
||||||
(function () {
|
|
||||||
document.querySelectorAll('.chroma > table')
|
|
||||||
.forEach((element) => {
|
|
||||||
const sub = element.querySelector('code[data-lang]');
|
|
||||||
if (sub) {
|
|
||||||
$(element).closest('div.chroma').attr('data-lang', mapLang(sub.getAttribute('data-lang')));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
})();
|
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
document.querySelectorAll('.single__contents > pre > code')
|
document.querySelectorAll('.single__contents > pre > code')
|
||||||
.forEach((element) => {
|
.forEach((element) => {
|
||||||
|
@ -98,19 +86,11 @@
|
||||||
coffeescript: 'CoffeeScript',
|
coffeescript: 'CoffeeScript',
|
||||||
cpp: 'C++',
|
cpp: 'C++',
|
||||||
cs: 'C#',
|
cs: 'C#',
|
||||||
css: 'CSS',
|
|
||||||
html: 'HTML',
|
|
||||||
http: 'HTTP',
|
|
||||||
js: 'JavaScript',
|
js: 'JavaScript',
|
||||||
json: 'JSON',
|
json: 'JSON',
|
||||||
objectivec: 'Objective-C',
|
objectivec: 'Objective-C',
|
||||||
php: 'PHP',
|
|
||||||
sql: 'SQL',
|
|
||||||
toml: 'TOML',
|
|
||||||
ts: 'TypeScript',
|
ts: 'TypeScript',
|
||||||
typescript: 'TypeScript',
|
typescript: 'TypeScript',
|
||||||
xml: 'XML',
|
|
||||||
yaml: 'YAML',
|
|
||||||
}[name] || name.toUpperCase();
|
}[name] || name.toUpperCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue