Use glide with flexbox
See original GitHub issueExample project: https://codepen.io/dodozhang21/project/editor/DNxweB
I’m dynamically mout/destroy the glide based on breakpoints.
For breakpoint narrow desktop and higher, I need to add a right rail to the right of glide. So I used flexbox to create the layout. As the right rail width is fixed but the content width should flex.
.gridBContainer {
@include narrow-desktop {
display: flex;
.galleryContainer {
flex: 100 0 1px;
margin-right: 20px;
}
.right {
flex: 0 0 #{$right-rail-width};
background: gray;
}
}
}
However it seems glide cannot figure out the width of the .galleryContainer
without me explicitly setting a width on the container.
Is this a bug or am I doing something wrong?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:9
- Comments:5
Top Results From Across the Web
How To Create a Slider or Carousel in Minutes Using Glide.js
In this video you will learn how to create a slider or carousel using Glide.js. This is just a starting point, make sure...
Read more >StaggeredLayout with FlexboxLayoutManager - Stack Overflow
I there any way to implement a staggered layout using google's Flexbox library similar to this. Layout implemented using StaggeredLayoutManager.
Read more >A Complete Guide to Flexbox | CSS-Tricks
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible ...
Read more >Flexbox's Best-Kept Secret - Medium
Using auto margins with Flexbox is an effective way to get all of the flexibility of css floats, without the nastiness of breaking...
Read more >Using Flexbox layouts in UI Builder
Create a Flexbox layout in UI Builder to build powerful pages so ... Activate application restricted caller access ... Glide Server APIs.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This can easily be fixed by setting the flex item’s
min-width
to 0. Example with inline css:This happens because flex items have a
min-width
ofauto
- which messes with the calculationsHad the same issue. Setting explicit width kind of works but missed the flex part. After digging around I found a better solution for anyone who come across this.
The root cause is in flex box, JS code cannot figure out the correct width of a div. To solve this we can use an absolute positioned div to fill the flex div. We also need to use the aspect ratio hack to make the height of flex div correct.
Basically we need two wrapper divs.