Browser: Any OS: macOS URL: Link to a page that illustrates this issue
I have a load of css that in post content and rich text elements spaces headings, texts and lists. I was excited to see in v2 that Bricks was handling this.
However for list items there is an issue that the defined padding is not being applied to the first item in the list if there is nothing preceding the list itself (Bricks is looking for * + li):
If you take a look at the page āCare for creationā you will see a rich text element list at the bottom of the page on its own with nothing preceding it in the text element. The inline padding start I have set for list items (1rem) in contextual spacing is not being applied to the first list item, because this is the rule bricks is using:
.brxe-text * + :is(li)
So because the first list item has nothing before it, the padding is not applied.
Hi Simon,
Iāll jump in here too, since Matej is out of the office and Iāve already looked at all your other issues anyway
This is not a bug, but rather a āmisuseā (or misunderstanding) of contextual spacing.
Contextual spacing applies to⦠elements with a preceding sibling within embedded content.
The first li doesnāt have a preceding sibling and therefore, the style doesnāt apply. In general, the contextual spacing is meant for vertical spacing between sibling elements.
The easiest way to add the li spacing correctly is with custom CSS, either in the Theme Styles (available since 2.0 RC), the Bricks settings or your child themeās stylesheet.
Hmm, can I suggest then that you remove the padding options if it is vertical spacing this is aimed at. I understand what contextual spacing is. ACSS did this for me before and I have my own CSS to do all of this (more detailed than what Bricks now does) and all it should do is vertical spacing but you have added padding options so I tried it and the result is not good if the list is not preceded by anything.
I get margin not being applied to the first item in the list if there is nothing above it but padding left and right would need to be applied to all list items. Surely for padding you can amend the code to simply include all list items? I donāt see why we should have to write a fix for the first item padding when you do all the rest.