HI @alexander!
I know this will be off-topic from the next release, but I feel we should discuss this.
I am struggling keeping markup valid in many cases.
1.
For example, if I want the Row element to be ul
, I’d expect its children to be able to be li
elements. We can change columns to li
, but then the ul
is at the wrong place:
<ul class="x-row">
<div class="x-row-inner">
<li class="x-col">
</li>
</div>
</ul>
It should be on the x-row-inner
container.
2.
We have the wonderful Navigation dropdown element, which can be turned into megamenus. However, in reality, we need a few navigation inline items and a few dropdown modals.
The problem is that the two aren’t connected. Navigation items should be nested inside the nav
tag, and individual items should be li
wrapped inside an ol
or ul
. This seems impossible with the dropdown element that is placed as part of the navigation. We should be able to add the li
tag to any Toggle and we should be able to combine top navigation items and other containers inside a single ol
or ul
.
3.
We should be able to follow the standards laid out in the Storefront theme if we chose to, when building WooCommerce Archive and Single layouts. The goal is to maximize third-party compatibility. Many plugins and analytics solutions use native structure and classes.
Markup
For example, products container should be ul
, and product items should beli
, but the issue described above prevents this. We can only build it inside the div, but then we lose all the flexbox convenience of the Row element.
With regards of the h
tags, we often need to combine data from different dynamic sources and still be able to wrap them inside an h1
for example. At least the Heading element should be able to wrap the subheading into the main h
tag, or even better, a Div element should be able to output an h
tag, or to be able to receive a custom tag of our choice.
Classes
Additionally, as soon as we add native WooCommerce classes to elements, WooCommerce CSS kicks in. These classes are often needed for compatibility reasons, and since we are building our own layouts, WooCommerce CSS isn’t needed. It will only create conflicts. A native way of removing it from layouts should be available.
Hooks
Lastly, many third-party plugins rely on WooCommerce hooks. Since we are building our own layouts, they are not present. There is no way to include them, as far as I know. I think there should be a Hook element that we can drop into appropriate places.
Please forgive me for making this thread so broad, but I feel that everything mentioned is connected.
Thanks!