Skip to content

Commit

Permalink
Remove style attribute manipulation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Jul 28, 2023
1 parent db84b3e commit ec85f70
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/scripts/scroll_to_bottom.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ let active = false;
let scrollElement;

const styleElement = buildStyle(`
.${buttonClass} {
margin-top: 0.5ch;
transform: rotate(180deg);
}
${keyToCss('drawer')} .${buttonClass} {
margin-top: 1ch;
}
.${activeClass} svg use {
--icon-color-primary: rgb(var(--yellow));
}
Expand Down Expand Up @@ -75,8 +84,6 @@ const addButtonToPage = async function ([scrollToTopButton]) {
scrollToBottomButton = scrollToTopButton.cloneNode(true);
hiddenClasses.forEach(className => scrollToBottomButton.classList.remove(className));
scrollToBottomButton.removeAttribute('aria-label');
scrollToBottomButton.style.marginTop = '0.5ch';
scrollToBottomButton.style.transform = 'rotate(180deg)';
scrollToBottomButton.addEventListener('click', onClick);
scrollToBottomButton.classList.add(buttonClass);

Expand All @@ -95,8 +102,6 @@ const addModalButtonToPage = async function ([modalScrollToTopButton]) {
modalScrollToBottomButton = modalScrollToTopButton.cloneNode(true);
hiddenClasses.forEach(className => modalScrollToBottomButton.classList.remove(className));
modalScrollToBottomButton.removeAttribute('aria-label');
modalScrollToBottomButton.style.marginTop = '1ch';
modalScrollToBottomButton.style.transform = 'rotate(180deg)';
modalScrollToBottomButton.addEventListener('click', onClick);
modalScrollToBottomButton.classList.add(buttonClass);

Expand Down

0 comments on commit ec85f70

Please sign in to comment.