Skip to content

Commit

Permalink
fix(front): adds styles and html for post hero image fallback (#704)
Browse files Browse the repository at this point in the history
closes #677
  • Loading branch information
dgrebb authored Sep 28, 2023
1 parent 918dc56 commit c62d724
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions front/src/lib/components/posts/PostHero.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,12 @@
style={heroThumb &&
`background-image: url('${heroThumb}'); background-position: ${position};`}
/>
<noscript>
<div
class="hero noscript"
style={heroImage &&
`background-image: url('${heroImage}'); background-position: ${position};`}
/>
</noscript>
</div>
{/if}
3 changes: 3 additions & 0 deletions front/src/lib/styles/pages/post.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@
&.loaded {
z-index: 18;
}
noscript .noscript {
display: none;
}
}
}
h1.post-title,
Expand Down
6 changes: 6 additions & 0 deletions front/static/styles/noscript.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ body .footer {
display: none;
}
}
.post .hero-wrap .hero.hero-thumbnail {
display: none;
}
.post .hero-wrap noscript .hero.noscript {
display: block;
}

0 comments on commit c62d724

Please sign in to comment.