Skip to content

Commit 676f262

Browse files
authored
UI changes for better dsiplay on small screen size (#43)
* Update nutrition_labels_creator.py table adjustments for mobile screen * Update header.html remove overlap of Previous and Next page arrows on mobile screen * Update extra.css remove extra padding in table column width. * Update colors.html changed few colours which were too dark for dark mode.
1 parent e2d05a0 commit 676f262

File tree

4 files changed

+40
-36
lines changed

4 files changed

+40
-36
lines changed

docs/assets/stylesheets/extra.css

+5-1
Original file line numberDiff line numberDiff line change
@@ -267,4 +267,8 @@
267267
.md-typeset table:not([class]) th {
268268
background-color: var(--md-table-header-bg-color);
269269
color: var(--md-table-header-font-color);
270-
}
270+
font-weight: 700;
271+
padding: .9375em 1.25em;
272+
vertical-align: top;
273+
min-width: 0;
274+
}}

overrides/partials/colors.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
"#ff006e",
66
"#fb5607",
77
"#ffbe0b",
8-
"#9d0208",
8+
"#029d14",
99
"#90be6d",
10-
"#9a031e",
11-
"#390099",
10+
"#f30731",
11+
"#448aff",
1212
"#8ecae6",
1313
"#ffc971",
1414
"#392f5a"

overrides/partials/header.html

+31-31
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,39 @@
2626
{% endif %}
2727
</span>
2828
</div>
29-
{% if page.previous_page or page.next_page %}
30-
<style>
31-
.md-header__nav {
32-
float: right;
33-
}
34-
.md-header__nav__inner:not([hidden]) {
35-
display: flex;
36-
}
37-
</style>
38-
<div class="md-header__nav">
39-
{% set hidden = "hidden" if "footer" in page.meta.hide %}
40-
<nav class="md-header__nav__inner"{{ hidden }}>
41-
{% if page.previous_page %}
42-
{% set direction = lang.t("footer.previous") %}
43-
<a href="{{ page.previous_page.url | url }}" aria-label="{{ direction }}: {{ page.previous_page.title | e }}" rel="prev">
44-
<div class="md-footer__button md-icon">
45-
{% include ".icons/material/arrow-left.svg" %}
46-
</div>
47-
</a>
48-
{% endif %}
49-
{% if page.next_page %}
50-
{% set direction = lang.t("footer.next") %}
51-
<a href="{{ page.next_page.url | url }}" aria-label="{{ direction }}: {{ page.next_page.title | e }}" rel="next">
52-
<div class="md-footer__button md-icon">
53-
{% include ".icons/material/arrow-right.svg" %}
54-
</div>
55-
</a>
56-
{% endif %}
57-
</nav>
58-
</div>
59-
{% endif %}
6029
</div>
6130
</div>
31+
{% if page.previous_page or page.next_page %}
32+
<style>
33+
.md-header__nav {
34+
float: right;
35+
}
36+
.md-header__nav__inner:not([hidden]) {
37+
display: flex;
38+
}
39+
</style>
40+
<div class="md-header__nav">
41+
{% set hidden = "hidden" if "footer" in page.meta.hide %}
42+
<nav class="md-header__nav__inner"{{ hidden }}>
43+
{% if page.previous_page %}
44+
{% set direction = lang.t("footer.previous") %}
45+
<a href="{{ page.previous_page.url | url }}" aria-label="{{ direction }}: {{ page.previous_page.title | e }}" rel="prev">
46+
<div class="md-footer__button md-icon">
47+
{% include ".icons/material/arrow-left.svg" %}
48+
</div>
49+
</a>
50+
{% endif %}
51+
{% if page.next_page %}
52+
{% set direction = lang.t("footer.next") %}
53+
<a href="{{ page.next_page.url | url }}" aria-label="{{ direction }}: {{ page.next_page.title | e }}" rel="next">
54+
<div class="md-footer__button md-icon">
55+
{% include ".icons/material/arrow-right.svg" %}
56+
</div>
57+
</a>
58+
{% endif %}
59+
</nav>
60+
</div>
61+
{% endif %}
6262
{% if not config.theme.palette is mapping %}
6363
<form class="md-header__option" data-md-component="palette">
6464
{% for option in config.theme.palette %}

parser/nutrition_labels_creator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,5 +177,5 @@ def fn_total_df_weight(input_string) -> tuple[dict, str, int]:
177177
}, inplace=True)
178178
#net_carbs_table_found_ingredients = found_entries[['Ingredient', 'Quantity', 'Unit', 'Qty in gms', 'Source', 'Net Carbs (gms)']].round(2).to_markdown(index=False)
179179
#nutrient_labels = f"## Nutrition Label\n\n{get_label_string(total_weight_df,missing_ingredients_string,serving_size)}"
180-
net_carbs_table_found_ingredients = found_entries[['Ingredient', 'Qty in recipe', 'Qty in gms', 'Net Carbs (gms)', 'Source']].round(2).to_markdown(index=False)
180+
net_carbs_table_found_ingredients = found_entries[['Ingredient', 'Qty in recipe', 'Net Carbs (gms)', 'Qty in gms', 'Source']].round(2).to_markdown(index=False)
181181
return total_weight_df.to_dict(), missing_ingredients_string, serving_size, net_carbs_table_found_ingredients

0 commit comments

Comments
 (0)