Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update styles.css --yt-searchbox-background -> --ytd-searchbox-backgr… #2143

Merged
merged 4 commits into from
Apr 1, 2024

Conversation

raszpl
Copy link
Contributor

@raszpl raszpl commented Apr 1, 2024

YT no longer uses --yt-searchbox-background, its renamed to --ytd-searchbox-background. Fixes searchbox color in all themes

custom was missing --ytd-searchbox-background --ytd-searchbox-legacy-button-color
need to cover [dark] too because this code runs too early for document.querySelector('ytd-masthead')?.removeAttribute('dark');

loading page with YT dark cookie and Custom theme generates ytd-masthead after myColors() and slaps [dark] attribute on it
@ImprovedTube
Copy link
Member

Guess it can be replaced somewhere along the path #search-form #container #search-input #search

and maybe it still exists on some systems or with some of Youtube's experiment flags?

@ImprovedTube ImprovedTube merged commit 2bac153 into code-charity:master Apr 1, 2024
@raszpl
Copy link
Contributor Author

raszpl commented Apr 2, 2024

can always go extra safe and keep both
--yt-searchbox-background
--ytd-searchbox-background

@raszpl raszpl deleted the patch-3 branch April 2, 2024 11:31
@ImprovedTube
Copy link
Member

what might it mean?

considering view-source:

year yt- amount ytd- amount
2024 32 63
2021 31 61
2020 24 58
2018 & 2019 700 0
2014 1400 0
2013 1 0

@ImprovedTube
Copy link
Member

'html, [dark] {' helps where?

ImprovedTube added a commit that referenced this pull request Apr 3, 2024
@raszpl
Copy link
Contributor Author

raszpl commented Apr 3, 2024

'html, [dark] {' helps where?

"need to cover [dark] too because this code runs too early for document.querySelector('ytd-masthead')?.removeAttribute('dark');

loading page with YT dark cookie and Custom theme generates ytd-masthead after myColors() and slaps [dark] attribute on it"

TLDR set YT cookie to dark, set custom theme, myColors() is being called somewhere early in core.js before YT adds [dark] to ytd-masthead, as a result
document.querySelector('ytd-masthead')?.removeAttribute('dark');
doest have anything to remove
then during YT load YT adds [dark] and we end up with custom theme with BLACK search bar
adding [dark] to custom CSS means we no longer need to call ever again:

				document.documentElement.removeAttribute('dark');
				document.querySelector('ytd-masthead')?.removeAttribute('dark');

can delete those lines after testing CSS covers everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants