Skip to content

Commit

Permalink
Improve image style (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
cotes2020 committed Dec 14, 2020
1 parent c9a2ee3 commit eb76d43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ <h1 data-toc-skip>{{ page.title }}</h1>
<div class="post-content">
{%- capture img_placehodler -%}
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
{% endcapture%}
{%- endcapture -%}

{% if page.image %}
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="post-preview-img">
<img src="{{ img_placehodler }}" data-src="{{ page.image }}" class="preview-img">
{% endif %}

<!-- Using lozad. See: <https://github.com/ApoorvSaxena/lozad.js#usage> -->
Expand Down
4 changes: 2 additions & 2 deletions assets/css/_addon/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -807,10 +807,10 @@ div.post-content .table-wrapper {
word-wrap: break-word;

@mixin img($caption: false) {
> img:not([style]) {
> img[data-src] {
margin: 0.5rem 0;

&:not(.normal):not(.left):not(.right) {
&:not([class]) {
@include align-center;

@if $caption {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/post.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ $prompt-newer: "{{ site.data.label.post.button.next }}";
margin: 1rem 0 0.8rem;
}
}
.post-preview-img {
.preview-img {
margin-top: 0;
margin-bottom: 2.5rem;
@include align-center;
Expand Down

0 comments on commit eb76d43

Please sign in to comment.