purescript-contrib / purescript-css

A clean, type-safe library for describing, manipulating and rendering CSS
Apache License 2.0
106 stars 40 forks source link

flexbox support #20

Closed mpodlasin closed 8 years ago

mpodlasin commented 8 years ago

Hi. This is my solution for adding flexbox. I used typeclasses, because I wanted user to reuse some values. For example both justifyContent and alignContents can have value FlexStart. This results in ease of use, but type error messages might be a little bit cryptic (?).

I followed this as a guide: https://css-tricks.com/snippets/css/a-guide-to-flexbox/

Note also line 111 in Flexbox.purs: value (JustifyStartEndCenter (FlexStartEndCenter v)) = v. Even though FlexStartEndCenter is instance of Val typeclass (see line 60). when in line 111 i wrote value (JustifyStartEndCenter v) = value v, it did not compile with error message Unknown value value. Why is that?

garyb commented 8 years ago

Thanks for working on this, sorry I never got back to you. I think FlexBox support was included in #29, so hopefully that will accommodate your needs! If not, please open a new PR and I will get it merged in a timely fashion this time.