css-gridish
css-gridish copied to clipboard
Margin bottom on last-child
Hi there,
This selector seems to be causing some strange behaviour for elements on my site - it looks like it has a high specificity level that's overriding margins on my own components.
Wondering if you have any ideas or suggestions for this?
Cheers!
This was a fix to solve bottom margin on the last elements in a grid messing everything up. Particularly with default margin bottom on type elements. It tends to be more helpful than destructive. However, the only workaround I know of is !important
.
So if you can think of a more graceful way, let me know.
Seeing as you're now using helper classes for grid columns, as well as for the flex fallback, perhaps this fix could be added to those instead? What do you think?
What if you use a type element as a grid child though? I think we would need to disable that child’s native margin bottom.
Can you share an example situation from your site? That may help show what we should avoid targeting.