Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix invalid html structure on menu grand children

NyanKiyoshi86eeed24cb23
diff --git a/saleor/static/scss/components/_header.scss b/saleor/static/scss/components/_header.scss
index a99b6e9a27..2fcb771010 100644
--- a/saleor/static/scss/components/_header.scss
+++ b/saleor/static/scss/components/_header.scss
@@ -54,11 +54,6 @@
background-color: $white;
text-align: left;
- .container {
- padding: $global-padding;
- max-height: 28rem;
- }
-
a {
padding: 0;
font-size: initial;
@@ -66,16 +61,23 @@
text-decoration: none;
}
- ul {
- min-width: 120px;
- width: 360px;
+ .container {
+ padding: $global-padding;
+ max-height: 28rem;
+
+ > ul {
+ min-width: 120px;
+ width: 360px;
+ display: flex;
+ flex-wrap: wrap;
- li {
- display: inline-block;
- max-width: 110px;
+ li {
+ display: inline-block;
+ max-width: 110px;
- &:not(:last-child) {
- margin-right: $global-padding * 2;
+ &:not(:last-child) {
+ margin-right: $global-padding * 2;
+ }
}
}
}
diff --git a/templates/menu.html b/templates/menu.html
index bc417c2748..c8d16b379c 100644
--- a/templates/menu.html
+++ b/templates/menu.html
@@ -21,20 +21,21 @@
{% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=child %}
{% endif %}
</a>
+
+ {% with grandchildren=child.child_items %}
+ {% if grandchildren %}
+ <ul>
+ {% for grandchild in grandchildren %}
+ <li>
+ <a href="{{ grandchild.url }}">
+ {% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=grandchild %}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
+ {% endwith %}
</li>
- {% with grandchildren=child.child_items %}
- {% if grandchildren %}
- <ul>
- {% for grandchild in grandchildren %}
- <li>
- <a href="{{ grandchild.url }}">
- {% get_menu_item_name lang_code=LANGUAGE_CODE menu_item=grandchild %}
- </a>
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endwith %}
{% endfor %}
</ul>
</div>