Glide: Incorrect widths when placed inside grid

Created on 23 Aug 2018  路  1Comment  路  Source: glidejs/glide

A bit of an edge case here, but it appears the size calculations get crazy when you use glide inside of a grid area that has been sized with fr units. The initial offsetWidth is correct but once the slides start to get their sizes it grows exponentially.

https://codepen.io/caseyjacobson/pen/xaGpaE

Most helpful comment

https://www.w3.org/TR/css-grid-1/#min-size-auto

The default minimum size of a grid area is the size of its content. This is why the grid area grows in size when explicit widths are set on each slide. The solution to the problem is to add min-width: 0; to that grid area. I've updated the codepen example for anybody else that runs into this same issue.

>All comments

https://www.w3.org/TR/css-grid-1/#min-size-auto

The default minimum size of a grid area is the size of its content. This is why the grid area grows in size when explicit widths are set on each slide. The solution to the problem is to add min-width: 0; to that grid area. I've updated the codepen example for anybody else that runs into this same issue.

Was this page helpful?
0 / 5 - 0 ratings