eightshift-frontend-libs icon indicating copy to clipboard operation
eightshift-frontend-libs copied to clipboard

[BUG] Wrapper css vars are inherited in the child blocks when using CSS variables

Open dingo-d opened this issue 4 years ago • 0 comments

If I put a columns block and inside a column, any other block, when setting any of the variables in the wrapper on the columns, those variables will be inherited in the child wrappers.

So, for instance, setting a top margin on the columns wrapper to 100 will mean that any element inside will have the same top margin (unless the defaults are set to some other value than 0).

Setting any of these wrapper values to 0, won't actually set them to 0, which is also a bit annoying.

EDIT

My guess is that in the setVariablesToBreakpoints method there is a check on line 612, where it checks for !empty($attributeValue), which is a false in the case a 0 is provided, so this override isn't set.

The quick and dirty solution is to set all these margin values in the wrapper to 1, so that they don't get overwritten. But this is just a bandage solution.

EDIT 2

We need to also devise a way to exclude the colors if one is set on the parent. For instance, I can set the default to be a project color that is transparent, but if I set the parent to gradient, the child blocks will automatically have the gradient bg set on them.

dingo-d avatar Jul 31 '21 07:07 dingo-d