backdrop-contrib / mini_layouts

Provide blocks which allow positioning content within them in layouts.
GNU General Public License v2.0
7 stars 4 forks source link

Add/change classes on the Layout when it is used as a mini-layout. #36

Open jenlampton opened 1 year ago

jenlampton commented 1 year ago

When I use the moscone layout as a mini-layout inside a page that also uses the moscone layout, selectors affecting my outer layout are also (inadvertently) affecting my inner one, because they have the exact same classes: layout--moscone layout

Though it is possible that I can un-do all the unwanted styling added by adding the selector .layout, It's a lot of extra work.

If the mini-layouts used different classes, maybe something like mini-layout--moscone mini-layout then I wouldn't need to un-do all the styles intended for my page layout.

Is there a use-case where styles intended for the page are also intended for a block? It's possible, but I doubt it's 80%. Please weigh in here if you have such a use-case!

jenlampton commented 1 year ago

I wasn't able to modify the layout template class since that was hard-coded into the layout template, so instead I added another one specifically for the mini-layouts. Here's what the classes look like after the changes in the PR: layout--moscone mini-layout--moscone mini-layout.