-
Notifications
You must be signed in to change notification settings - Fork 49
Description
The big picture of what I'm trying to do
I'm trying to align my content inside a grid.
grid Ss.PageGrid
[ width w
, height h
, center
]
{ columns =
[ fill, px 640, fill ]
, rows =
[ px 60, fill, px 60 ]
, cells =
[ cell
{ start = ( 0, 0 )
, width = 3
, height = 1
, content = header
}
, cell
{ start = ( 0, 1 )
, width = 3
, height = 1
, content = content
}
, cell
{ start = ( 0, 2 )
, width = 3
, height = 1
, content = footer
}
]
}
What I did
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.
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 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).
Versions
- Elm: 0.18
- style-elements: 4.3.0
- Browser: Chrome 65.0.3325.181
- Operating System: macOS 10.13.4

