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

Flexbox keywords #13

Closed
9 tasks
rtfeldman opened this issue Dec 21, 2015 · 11 comments
Closed
9 tasks

Flexbox keywords #13

rtfeldman opened this issue Dec 21, 2015 · 11 comments

Comments

@rtfeldman
Copy link
Owner

These are keywords necessary to cover Flexbox

@NicholasGWK
Copy link
Contributor

Working on these currently, so nobody else picks them up :).

@joshmh
Copy link
Contributor

joshmh commented Jan 6, 2016

See #58

@NicholasGWK
Copy link
Contributor

Thanks, that's my PR when I just asking Richard some questions :P Just though I'd post here now that I've done a few more in case nobody checked the PRs

@joshmh
Copy link
Contributor

joshmh commented Jan 6, 2016

Haha, right. Somehow I missed that it was you. Looking forward to this.

@NicholasGWK
Copy link
Contributor

Having an issue with flex-flow, and likely flex.

With flex-flow, it can accept either flex-direction, flex-row, or both, in any order since the keywords are unique.

My problem is, with most multi-parameter CSS properties, they have a defined order. For example, with text-shadow, you must do "color" followed by "values" or vice versa. Also, you must have both to specify color (you can't do text-shadow: red) for example.

With flex-flow though, you can do any combination including omitting either, i.e

   ~ flexFlow wrap  
   ~ flexFlow row  
   ~ flexFlow wrap row  
   ~ flexFlow row wrap 

Should all be valid in your CSS file! I'm having trouble figuring this out since in Elm the order of inputs is defined and type specific. And, even if I force the order, I still have to account for leaving one out, which I can't seem to figure out using Maybe/Nothing with an extensible record:

flexFlow : Maybe ( FlexDirection compatible) -> Mixin namespace
flexFlow direction =
    withDefault { direction | value = "row", flexDirection = Compatible } direction  

Or something of the like doesn't seem to play nice, and would still require the user to do flexFlow Nothing row or whatever which at the point it makes as much sense to just force them to define both parameters. Although this is not a huge deal, I'd like to support entering values the same way they are supported in CSS, ie in "the order of appearance in the formal grammar of the values".

Any comments or suggestions welcome!

Thanks,

Nick

@jgillich
Copy link

@NicholasGW I'm pretty new to Elm, but at least for now, what about simply not implementing shorthands? flex-flow is just a shorthand for flex-direction and flex-wrap, which both take a single value.

Have you made any progress so far? I'd like to help to make this happen.

@NicholasGWK
Copy link
Contributor

@jgillich Thanks for the input, but I actually got flexbox done in PR #58!

#58

@jgillich
Copy link

Cool, totally missed that! I guess this can be closed then? @rtfeldman

@jgillich
Copy link

How do you set display: flex? Looks like that isn't implemented, or I'm missing something again.

@NicholasGWK
Copy link
Contributor

@jgillich right you are! I think it might work by virtue of using a string but there definitely should be a defined function for it like there is for inline or inline-block etc. Care to take a stab?

@rtfeldman
Copy link
Owner Author

I've decided to close all the missing keywords issues in favor of letting people make PRs based on what specific things they wish existed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants