Using CSS Grid with Bootstrap? Is it time, yet? #36555
Replies: 5 comments 5 replies
-
Hee there, I've been using css grids for quite some time to build websites (creating fallbacks by first building the element using display block combined with floating, or just using display flex and putting the css grid code in the And why the opt-in for css grids? If you don't want to use css grids, you don't put the d-grid class in your html, right? For context, and to be clear, in Bootstrap you can use layouts in 3 ways:
An even more radical idea: I would propose to get rid of the Bootstrap grid system entirely, from let's say Bootstrap 6, and replace the container-row-col structure with a new Bootstrap grid system based on css grids, which does this in a cleaner way. I find the Bootstrap grid system hacky because of the use of negative margins to create the column structure. When applying margins to columns, the negative margins (of these columns) is interfered with and the layout doesn't look like what you would expect. The same goes for applying padding to containers, which already have a default padding set to them. Concerning the choice of flexbox vs css grids, I would always keep using both, for flexbox in my view, combines perfectly well together with css grids. It's a match made in heaven for us layout perfectionists. To see the main discussion about implementing css grids, see #31813 |
Beta Was this translation helpful? Give feedback.
-
I think that someday, this css grid method should be supported as a regular method and two-track along with a flex method. |
Beta Was this translation helpful? Give feedback.
-
When building a website with Jekyll, because of the liquid template syntax, there is a filter called |
Beta Was this translation helpful? Give feedback.
-
thanks for your perspective. building website. |
Beta Was this translation helpful? Give feedback.
-
I've been watching a few videos on the wonders of the newer CSS Grid layout module available in modern CSS. Boostrap, since v5.1.0, offers an opt-in experimental CSS Grid system. While I would like to start using CSS Grid in my designs, I am hesitant because mobile visitors have to use the latest versions of their browser for it to work. For example, https://caniuse.com/css-grid lists Firefox 101 (for android) as the earliest version that supports CSS Grid, and it was just released in May of this year. Unless I am willing to provide a fallback for just-out-of-date browsers, it still seems premature to use CSS grid?
Are you using CSS Grid yet in your responsive website designs for mobile devices? Or, is it still Flexbox all the way?
Beta Was this translation helpful? Give feedback.
All reactions