Created
January 31, 2015 17:48
-
-
Save TheSeamau5/717dbf7d299b2774634d to your computer and use it in GitHub Desktop.
Wrapping CSS Layout in Elm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type alias Bounds = { | |
left : Float, | |
right : Float, | |
top : Float, | |
bottom : Float | |
} | |
bounds : Bounds | |
bounds = Bounds 0 0 0 0 | |
type FlexDirection = Row | Column | |
type FlexAlignment = FlexStart | | |
Center | | |
FlexEnd | | |
Stretch | | |
SpaceBetween | | |
SpaceAround | |
type PositionType = Relative | Absolute | |
type alias Style = { | |
dimensions : { | |
width : Float, | |
height : Float | |
}, | |
position : Bounds, | |
margin : Bounds, | |
padding : Bounds, | |
borderWidth : Bounds, | |
flexDirection : FlexDirection, | |
justifyContent : FlexAlignment, | |
alignItems : FlexAlignment, | |
alignSelf : FlexAlignment, | |
flex : Float, | |
positionType : PositionType | |
} | |
style : Style | |
style = { | |
dimensions = { | |
width = 100, | |
height = 100 | |
}, | |
position = bounds, | |
margin = bounds, | |
padding = bounds, | |
borderWidth = bounds, | |
flexDirection = Column, | |
justifyContent = SpaceAround, | |
alignItems = Stretch, | |
alignSelf = Stretch, | |
flex = 1, | |
positionType = Relative | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment