Skip to content

Commit

Permalink
fix icons on theme changes
Browse files Browse the repository at this point in the history
Signed-off-by: vishalvivekm <[email protected]>
  • Loading branch information
vishalvivekm committed Jan 13, 2025
1 parent 6e43633 commit 5753829
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _includes/models/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
<h4 class="pattern-name">{{model.name}}</h4>
<div class="pattern-image-container">
<img class= "pattern-image model-image"
<img class= "model-image"
data-modelicon-light="{{model.colorIcon}}"
data-modelicon-dark="{{model.whiteIcon}}"
src="{{model.colorIcon}}"
Expand Down
2 changes: 1 addition & 1 deletion _sass/catalog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ p {
display: flex;
justify-content: center;
}
.pattern-image {
.pattern-image, .model-image {
width: 60%;
margin-top: 24px;
object-fit: contain;
Expand Down
4 changes: 3 additions & 1 deletion collections/_pages/catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ <h2 class="not-found" style="display: none;" id="not-found">
document.querySelectorAll(".pattern-image").forEach(e => {
e.src = event.detail.value == "dark-mode" ? e.dataset.snapshotDark : e.dataset.snapshotLight;
});

document.querySelectorAll(".model-image").forEach(e => {
e.src = event.detail.value == "dark-mode" ? e.dataset.modeliconDark : e.dataset.modeliconLight;
})
})
</script>

0 comments on commit 5753829

Please sign in to comment.