Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

header or footer tag changes the behaviour of the spread attributes for children elements #139

Open
ghost opened this issue Jan 30, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 30, 2018

The big picture of what I'm trying to do

I am trying to create a header, mainContent, and footer, and in my header and footer, a row which contains links spread horizontally.

What I did

The full example is in Ellie https://ellie-app.com/bnCJSq5zMa1/2, and here is an excerpt:

main : Html msg
main =
    layout stylesheet <|
        column None
            [ ]
            [ header Top [] <|
                row None
                    [ width fill, spread ]
                    [ el None [] (Element.text "top left")
                    , el None [] (Element.text "top right")
                    ]
            , el None [] (Element.text "Header and footer should not grow to 100% height")
            , footer Bottom [] <|
                row None
                    [ width fill, spread ]
                    [ el None [] (Element.text "bottom left")
                    , el None [] (Element.text "bottom right")
                    ]
            ]

What I Expected To Happen

I expected to have a small header, a small footer, and a tall main Content (because under the scene it has the height fill attribute)

What Actually Happened

The header and footer take each 100% of the screen height, and the main Content is small.

See : https://ellie-app.com/bnCJSq5zMa1/2

What is very strange, is that the behaviour disappears when I remove the header element and keep only the inside row. As you can see here: https://ellie-app.com/bnCJSq5zMa1/3, the header (which is now only a row) text has spread horizontally, but not vertically anymore. Which is what was expected.

It seems like that the header element adds a 100% height attribute to its child (by inspecting with dev tools), which is weird ?

Versions

  • Elm: 0.18
  • style-elements: 4.3.0
  • Browser: Version 64.0.3282.119
  • Operating System: Windows 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants