From e917e7c0dfcd26df71e55e7a1a41635362720cab Mon Sep 17 00:00:00 2001 From: gautamkrishnar Date: Tue, 31 Oct 2023 22:20:49 +0530 Subject: [PATCH] updated the subscribe button styling to match new youtube ui --- extension/script.js | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/extension/script.js b/extension/script.js index ce83d1e..5bad443 100644 --- a/extension/script.js +++ b/extension/script.js @@ -146,24 +146,7 @@ function ensureTALinks() { // fix positioning of #owner div to fit new button function adjustOwner(channelContainer) { - let sponsorButton = channelContainer.querySelector('#sponsor-button'); - if (sponsorButton === null) { - return channelContainer; - } - - let variableMinWidth; - if (sponsorButton.hasChildNodes()) { - variableMinWidth = '140px'; - } else { - variableMinWidth = '45px'; - } - - Object.assign(channelContainer.firstElementChild.style, { - minWidth: variableMinWidth, - }); - Object.assign(channelContainer.style, { - minWidth: 'calc(40% + 50px)', - }); + channelContainer = channelContainer.querySelector("#buttons"); return channelContainer; } @@ -197,16 +180,15 @@ function getChannelHandle(channelContainer) { function buildChannelButtonDiv() { let buttonDiv = document.createElement('div'); buttonDiv.classList.add('ta-channel-button'); - Object.assign(buttonDiv.style, { - display: 'flex', - alignItems: 'center', - backgroundColor: '#00202f', - color: '#fff', - fontSize: '14px', - padding: '5px', - margin: '5px', - borderRadius: '8px', + 'display': 'flex', + 'alignItems': 'center', + 'backgroundColor': '#00202f', + 'color': '#fff', + 'fontSize': '14px', + 'padding': '5px', + 'margin-left': '8px', + 'borderRadius': '18px', }); return buttonDiv; }