Add loadables for

- ShowCodeCopyButtons
- ShowPostNavLinks
- ShowShareButtons
- disableAnchoredHeadings
This commit is contained in:
Aditya Telange 2022-01-14 14:00:28 +05:30
parent e57d52f0a1
commit c9cde633e1
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77
7 changed files with 110 additions and 96 deletions

View File

@ -48,21 +48,3 @@ div.highlight,
pre { pre {
position: relative; position: relative;
} }
.copy-code {
display: none;
position: absolute;
top: 4px;
right: 4px;
color: rgba(255, 255, 255, 0.8);
background: rgba(78, 78, 78, 0.8);
border-radius: var(--radius);
padding: 0 5px;
font-size: 14px;
user-select: none;
}
div.highlight:hover .copy-code,
pre:hover .copy-code {
display: block;
}

View File

@ -329,46 +329,6 @@
background: var(--border); background: var(--border);
} }
.share-buttons {
margin: 14px 0;
padding-inline-start: var(--radius);
display: flex;
justify-content: center;
overflow-x: auto;
}
.share-buttons a {
margin-top: 10px;
}
.share-buttons a:not(:last-of-type) {
margin-inline-end: 12px;
}
.share-buttons a svg {
height: 30px;
width: 30px;
fill: currentColor;
transition: transform 0.1s;
}
.share-buttons svg:active {
transform: scale(0.96);
}
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
display: inline-flex;
color: var(--secondary);
margin-inline-start: 8px;
font-weight: 500;
user-select: none;
}
.post-content :not(table) ::-webkit-scrollbar-thumb { .post-content :not(table) ::-webkit-scrollbar-thumb {
border: 2px solid var(--hljs-bg); border: 2px solid var(--hljs-bg);
background: rgb(113, 113, 117); background: rgb(113, 113, 117);
@ -390,41 +350,3 @@ h6:hover .anchor {
.post-content table::-webkit-scrollbar-thumb { .post-content table::-webkit-scrollbar-thumb {
border-width: 2px; border-width: 2px;
} }
.paginav {
margin: 10px 0;
display: flex;
line-height: 30px;
border-radius: var(--radius);
}
.paginav a {
padding-inline-start: 14px;
padding-inline-end: 14px;
border-radius: var(--radius);
}
.paginav .title {
letter-spacing: 1px;
text-transform: uppercase;
font-size: small;
color: var(--secondary);
}
.paginav .prev,
.paginav .next {
width: 50%;
}
.paginav span:hover:not(.title) {
box-shadow: 0 1px 0;
}
.paginav .next {
margin-inline-start: auto;
text-align: right;
}
[dir="rtl"] .paginav .next {
text-align: left;
}

View File

@ -0,0 +1,11 @@
h1:hover .anchor,
h2:hover .anchor,
h3:hover .anchor,
h4:hover .anchor,
h5:hover .anchor,
h6:hover .anchor {
display: inline-flex;
color: var(--secondary);
margin-inline-start: 8px;
font-weight: 500;
}

View File

@ -0,0 +1,16 @@
.copy-code {
display: none;
position: absolute;
top: 4px;
right: 4px;
color: rgba(255, 255, 255, 0.8);
background: rgba(78, 78, 78, 0.8);
border-radius: var(--radius);
padding: 0 5px;
font-size: 14px;
}
div.highlight:hover .copy-code,
pre:hover .copy-code {
display: block;
}

View File

@ -0,0 +1,37 @@
.paginav {
margin: 10px 0;
display: flex;
line-height: 30px;
border-radius: var(--radius);
}
.paginav a {
padding-inline-start: 14px;
padding-inline-end: 14px;
border-radius: var(--radius);
}
.paginav .title {
letter-spacing: 1px;
text-transform: uppercase;
font-size: small;
color: var(--secondary);
}
.paginav .prev,
.paginav .next {
width: 50%;
}
.paginav span:hover:not(.title) {
box-shadow: 0 1px 0;
}
.paginav .next {
margin-inline-start: auto;
text-align: right;
}
[dir="rtl"] .paginav .next {
text-align: left;
}

View File

@ -0,0 +1,26 @@
.share-buttons {
margin: 14px 0;
padding-inline-start: var(--radius);
display: flex;
justify-content: center;
overflow-x: auto;
}
.share-buttons a {
margin-top: 10px;
}
.share-buttons a:not(:last-of-type) {
margin-inline-end: 12px;
}
.share-buttons a svg {
height: 30px;
width: 30px;
fill: currentColor;
transition: transform 0.1s;
}
.share-buttons svg:active {
transform: scale(0.96);
}

View File

@ -23,6 +23,26 @@
{{- $includes = (append $profileMode $includes) }} {{- $includes = (append $profileMode $includes) }}
{{- end }} {{- end }}
{{- if not (eq .Site.Params.features.ShowCodeCopyButtons false) }}
{{- $ShowCodeCopyButtons := (resources.Get "css/includes/show-code-copy-buttons.css") }}
{{- $includes = (append $ShowCodeCopyButtons $includes) }}
{{- end }}
{{- if not (eq .Site.Params.features.ShowPostNavLinks false) }}
{{- $ShowPostNavLinks := (resources.Get "css/includes/show-post-nav-links.css") }}
{{- $includes = (append $ShowPostNavLinks $includes) }}
{{- end }}
{{- if not (eq .Site.Params.features.ShowShareButtons false) }}
{{- $ShowShareButtons := (resources.Get "css/includes/show-share-buttons.css") }}
{{- $includes = (append $ShowShareButtons $includes) }}
{{- end }}
{{- if not (eq .Site.Params.features.disableAnchoredHeadings true) }}
{{- $AnchoredHeadings := (resources.Get "css/includes/show-share-buttons.css") }}
{{- $includes = (append $AnchoredHeadings $includes) }}
{{- end }}
{{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} {{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }}
{{- /* order is important */}} {{- /* order is important */}}