I tried using center and alignLeft/alignRight did not see any results. Upon inspecting the DOM, I discovered that center was being transformed to justify-content: center;. When I changed it to justify-items: center then it worked.
Typically justify-items is used more for display: grid, and justify-content is used more for display: flex. But they both have separate use-cases, and in this case I need justify-items. While searching for a solution, I found this commit and discovered that simply reverting it fixes my problem.
After a little more fiddling, I discovered that if I changed the columns from using fill to only px values then justify-content: center worked. It fails with %, fr, auto.
I can make a version in ellie-app if necessary -- but I think this should be pretty straight forward.
PS. I would love to use minmax() if possible. (I found it being used in an experiments file).
The big picture of what I'm trying to do
I'm trying to align my content inside a grid.
What I did
I tried using
center
andalignLeft
/alignRight
did not see any results. Upon inspecting the DOM, I discovered thatcenter
was being transformed tojustify-content: center;
. When I changed it tojustify-items: center
then it worked.After doing some research and digging into the grid spec I discovered the differences between them.
justify-items
justify-content
Typically
justify-items
is used more fordisplay: grid
, andjustify-content
is used more fordisplay: flex
. But they both have separate use-cases, and in this case I needjustify-items
. While searching for a solution, I found this commit and discovered that simply reverting it fixes my problem.After a little more fiddling, I discovered that if I changed the columns from using
fill
to onlypx
values thenjustify-content: center
worked. It fails with%
,fr
,auto
.I can make a version in ellie-app if necessary -- but I think this should be pretty straight forward.
PS. I would love to use
minmax()
if possible. (I found it being used in an experiments file).Versions