mdgriffith / style-elements

Create styles that don't mysteriously break!
http://package.elm-lang.org/packages/mdgriffith/style-elements/latest
BSD 3-Clause "New" or "Revised" License
445 stars 49 forks source link

`el` with `verticalCenter` has small height, despite `height fill` #126

Open Enkidatron opened 6 years ago

Enkidatron commented 6 years ago

The big picture of what I'm trying to do

I am trying to vertically center an element while also making it as tall as possible within a bound. This way it can react to siblings taking up space or the screen shrinking, but remains vertically centered on larger screens.

What I did

https://ellie-app.com/4G2dty9Jba1/0 In short: el Background [verticalCenter, height fill, maxHeight <| px 200]

What I Expected To Happen

I expected there to be a 200 px tall green block vertically centered in the screen.

What Actually Happened

There is a very short green block vertically centered in the screen.

screenshot from 2017-12-07 11-33-03

I have tested this on two setups, and it is only broken on one of them. It is broken on Ubuntu 16.04 LTS with Firefox 56.0 (64-bit). It works as I expect (is 200 px tall) on Safari/macOS.

Versions