Skip to content

Commit

Permalink
fix: center via image wrapper (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
Renji-XD authored Oct 9, 2024
1 parent 049a6e6 commit a731085
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions apps/web/src/lib/components/book-reader/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@
}
}

:global(.ttu-illustration-container) {
text-align: center;
:global(.ttu-img-parent) {
display: flex;
justify-content: center;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ function addSpoilerTags(el: HTMLElement, document: Document, blurMode: BlurMode)

const createWrapper = (tag: Element, childNode: Element) => {
const imgWrapper = document.createElement('span');
imgWrapper.toggleAttribute('data-ttu-spoiler-img');
const parentElement = tag.parentElement || childNode;

imgWrapper.classList.add('ttu-img-parent');
imgWrapper.toggleAttribute('data-ttu-spoiler-img');

parentElement.insertBefore(imgWrapper, tag);
imgWrapper.appendChild(tag);
};
Expand Down

0 comments on commit a731085

Please sign in to comment.