localgovdrupal / localgov_base

The base theme for LocalGov Drupal websites.
9 stars 15 forks source link

Add a grid system for views #536

Closed markconroy closed 6 months ago

markconroy commented 7 months ago

it would be handy to be able to drop css classes into our views for such as view--grid-thirds and let that automatically layout items in one column on mobile, 2 columns on tablet, and 3 columns on large screens.

Classes to include:

We might be able to extend our current lgd-row type system for this purpose.

While this will not suffice every layout for every view, I reckon it will suffice for 90% of them. Then we can easily drop the classes into the views CSS field.

Screenshot 2024-04-04 at 16 30 57

andybroomfield commented 7 months ago

BHCC has a few extensions to the lgd grid system, using classes m:lgd-row__one-quarter l:lgd-row__one-quarter etc.

markconroy commented 7 months ago

Thanks @andybroomfield, I think the approach I have is a little less sophisticated, but will cover most of our use cases, and should be easy to add to like in your examples above. I'll post a PR in a few minutes.

My hope later would be to deprecated the .lgd-row grid system we have (which uses flex) and move towards a newer system (which uses grid).