Apply suggestions from code review

Co-authored-by: Ben Busby <benbusby@pm.me>
This commit is contained in:
Alexandar Mechev 2020-10-23 18:10:15 +02:00 committed by GitHub
parent f606bdfe47
commit 95f12be5e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 11 deletions

View File

@ -58,7 +58,7 @@ class Filter:
selector_name = ".reskin-dark"
else:
selector_name = ".reskin"
reskin_selector = [i for i in sheet if i.selectorText==selector_name]
reskin_selector = [i for i in sheet if i.selectorText == selector_name]
if len(reskin_selector) == 0:
return result
for css_prop in reskin_selector[0].style:

View File

@ -300,9 +300,9 @@ class Config:
{'name': 'Zimbabwe', 'value': 'countryZW'}
]
THEMES = list(set([theme_name.split('.css')[0]
THEMES = set([theme_name.split('.css')[0]
for theme_name in os.listdir('app/static/css/themes/')
if "-search.css" not in theme_name]))
if "-search.css" not in theme_name])
def __init__(self, **kwargs):
self.url = ''

View File

@ -20,8 +20,8 @@
.autocomplete-items div {
padding: 10px;
cursor: pointer;
color: #3B4252 !important;
background-color: #ECEFF4 !important;
color: #3B4252;
background-color: #ECEFF4;
border-bottom: 1px solid #242424;
}
@ -48,4 +48,4 @@ body.dark * div#search-bar-autocomplete-list div:hover {
.autocomplete-active {
background-color: #685e79 !important;
color: #f9fafb !important;
}
}

View File

@ -20,8 +20,8 @@
.autocomplete-items div {
padding: 10px;
cursor: pointer;
color: #002b36 !important;
background-color: #eee8d5 !important;
color: #002b36;
background-color: #eee8d5;
border-bottom: 1px solid #242424;
}
@ -48,4 +48,4 @@ body.dark * div#search-bar-autocomplete-list div:hover {
.autocomplete-active {
background-color: #685e79 !important;
color: #f9fafb !important;
}
}

View File

@ -23,6 +23,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/css/main.css">
{% if config['theme'] %}
<link rel="stylesheet" href="/static/css/themes/{{config['theme']}}.css" />
<link rel="stylesheet" href="/static/css/themes/{{config['theme']}}-search.css" />
{% else %}
<link rel="stylesheet" href="/static/css/{{ 'dark-' if config['dark'] else '' }}theme.css" />
@ -100,7 +101,7 @@
<select name="theme" id="config-theme">
{% for theme in themes %}
<option value="{{ theme }}" {% if theme in config.theme %} selected {% endif %}>
{{ theme }}
{{ theme.capitalize() }}
</option>
{% endfor %}
</select>
@ -152,4 +153,4 @@
</footer>
</body>
</html>
</html>