add image-size-control shortcode

This commit is contained in:
Reorx 2022-05-05 16:49:21 +08:00
parent 3ba18bda18
commit cbba5c25bd
3 changed files with 20 additions and 1 deletions

View File

@ -66,3 +66,11 @@
#instantclick-bar { #instantclick-bar {
background: var(--tertiary-bg); background: var(--tertiary-bg);
} }
/* make zoom overlay and image higher than toc */
.medium-zoom-overlay {
z-index: 2;
}
.medium-zoom-image--opened {
z-index: 3;
}

View File

@ -273,7 +273,7 @@ h6:hover .anchor {
.post-content img { .post-content img {
border-radius: 4px; border-radius: 4px;
margin: 1rem 0; margin: 1rem auto;
} }
.post-content img[src*="#center"] { .post-content img[src*="#center"] {
@ -520,3 +520,8 @@ h6:hover .anchor {
padding: 1.5em; padding: 1.5em;
box-shadow: var(--shadow-elevation-low); box-shadow: var(--shadow-elevation-low);
} }
.image-size-control > img {
width: inherit;
height: inherit;
}

View File

@ -0,0 +1,6 @@
<div class="image-size-control" style="
{{- with (.Get "width") }}width: {{ . }};{{ end -}}
{{- with (.Get "height") }}height: {{ . }};{{ end -}}
">
{{ .Inner | markdownify }}
</div>