~taavi/taavi.wtf

1c412dc206f5a02a40973facad36442de8052dd2 — Taavi Väänänen 26 days ago ed01500 master
fix img-realsize on mobile
2 files changed, 17 insertions(+), 10 deletions(-)

M themes/castor/assets/css/styles.css
M themes/castor/layouts/shortcodes/img-realsize.html
M themes/castor/assets/css/styles.css => themes/castor/assets/css/styles.css +10 -4
@@ 119,13 119,19 @@ a:not(.nav-item):hover {
  grid-column: 4;
}

.container > p > img:not(.img-realsize),
.container > p > a > img:not(.img-realsize),
.container > div.img-page--image-container > img:not(.img-realsize) {
.container > p > img,
.container > p > a > img,
.container > div.img-page--image-container > img {
  width: 100%;
}

.container > p > img.img-realsize {
div.img-realsize-wrapper {
  /* center */
  display: block;
  margin: auto;
}

div.img-realsize-wrapper img.img-realsize {
  max-width: 100%;

  /* center */

M themes/castor/layouts/shortcodes/img-realsize.html => themes/castor/layouts/shortcodes/img-realsize.html +7 -6
@@ 1,8 1,9 @@
<p>
	<img
		src="{{ .Get 0 }}"
		alt="{{ .Get 1 }}"
		class="img-realsize"
		{{ with (.Get 2) }}style="max-width: {{ . }};"{{ end }}
	/>
	<div class="img-realsize-wrapper" {{ with (.Get 2) }}style="max-width: {{ . }};"{{ end }}>
		<img
			src="{{ .Get 0 }}"
			alt="{{ .Get 1 }}"
			class="img-realsize"
		/>
	</div>
</p>