Please use semantically correct text elements

Maybe there is a reason but I don’t get why Bricks use div elements for textelements instead of a semantically correct < p > Tag.

You have to change manually every single text element and you run into follow up issues when using frameworks like accss with gap and margin classes because that classes of course target the original elements.

Are there any reasons for not using < p > - Tag?

8 Likes

Textfields can be changed to < p > tag.
But I can’t think of a single reason that it is not standard a < p > tag. It actually blew my mind :sleepy: :scream: :see_no_evil:

3 Likes

Interested in this myself.

Hi,
Not sure that p tag should be default here.

I personnally rarely use text element for “paragraph” text purpose, since there’s the rich text element which is way more useful to me for this use case.

Most of the time, I use basic text element to display labels, sidebar links, taxonomy terms as tags, footer links, subtitles, etc, with dynamic data as the content, and for all these elements, p is not the right choice.

Maybe the issue here is that it’s not clear whether to use basic or rich text element and that rich text element includes a wrapper.

If I had to improve this area, I would do this:

  • keep the basic text element as is, but maybe rename it so that it is not so related to text content but to any content generated by text, including simple text, but might be hard to formulate this properly :wink:
  • automatically remove the rich text element’s wrapper when containing only one tag (p, ul, etc…), but it can have side effects if people use the wrapper to style content, so maybe this should be conditionned by a global setting option;
  • add an option to rich text element to remove the wrapper even if multiple tags are used, so that it can fit in a content flow (for example surrounded by titles, images, etc.), and maybe provide a global setting as well to automate this.
1 Like