Minor fix to dark mode on img results

main
Ben Busby 2020-05-15 14:17:16 -06:00
parent e3d002f6c1
commit afd5b9aa83
1 changed files with 9 additions and 3 deletions

View File

@ -78,7 +78,7 @@ class Filter:
# Special rebranding for image search results # Special rebranding for image search results
if img_src.startswith(LOGO_URL): if img_src.startswith(LOGO_URL):
img['src'] = '/static/img/logo.png' img['src'] = '/static/img/logo.png'
img['height'] = 40 img['style'] = 'height:40px;width:162px'
else: else:
img['src'] = BLANK_B64 img['src'] = BLANK_B64
@ -114,9 +114,15 @@ class Filter:
# Set up dark mode if active # Set up dark mode if active
if self.dark: if self.dark:
soup.find('html')['style'] = 'scrollbar-color: #333 #111;' soup.find('html')['style'] = 'scrollbar-color: #333 #111;color:#fff !important;background:#000 !important'
for input_element in soup.findAll('input'): for input_element in soup.findAll('input'):
input_element['style'] = 'color:#fff;' input_element['style'] = 'color:#fff;background:#000;'
for span_element in soup.findAll('span'):
span_element['style'] = 'color: white;'
for href_element in soup.findAll('a'):
href_element['style'] = 'color: white' if href_element['href'].startswith('/search') else ''
def update_links(self, soup): def update_links(self, soup):
# Replace hrefs with only the intended destination (no "utm" type tags) # Replace hrefs with only the intended destination (no "utm" type tags)