I am new to Sitecore/SXA, and I have recently joined a team as a front-end developer using these technologies.
One thing that I have noticed is that SXA adds extra unnecessary HTML tags in a lot of cases. Like if you have a content that will be rendered as a link, there's a checkbox
"Is a link", but it still has a Tag that you have to choose to wrap around this link. By default it's a
DIV, but if you leave it empty, it still produces a
DIV with a link inside. That's the case in some other scenarios and it can mess the final HTML, with a lot of noise that adds no value or meaning to the HTML, and it makes it harder to style in a clean way. Also, when an element like an anchor tag contains other elements, these are also wrapped into a
<div> (example below). This div is not necessary because the elements are already wrapped by the parent element, so it's redundant.
Any tips to improve this? Is this going to change with newer versions of SXA?
Sitecore/Content/WWW/Presentation/Rendering Variants/My Component/My Variant:
There's an extra div surrounding both sections inside the link: