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

margin needs a redesign #211

Open
BebeSparkelSparkel opened this issue Jul 30, 2020 · 3 comments
Open

margin needs a redesign #211

BebeSparkelSparkel opened this issue Jul 30, 2020 · 3 comments

Comments

@BebeSparkelSparkel
Copy link

Currently, margin :: Size a -> Size a -> Size a -> Size a -> Css accepts 4 arguments.
This makes it impossible to have margin: auto.

margin would be better if it accepted one argument.

margin :: ToMargin a => a -> CSS
margin = key "margin" . value

class ToMargin a where toMargin :: forall b. Val b => a -> b
instance ToMargin (a,b,c,d) where toMargin (w, x, y, z) = (w, (x, (y, z)))
instance ToMargin Auto where -- not correct but you get my drift
@turion
Copy link
Collaborator

turion commented Aug 1, 2020

How about simply adding a function marginAuto :: Css?

Or an algebraic datatype that works with the Val typeclass, like e.g. Color? See http://hackage.haskell.org/package/clay-0.13.1/docs/Clay-Color.html#t:Color

@BebeSparkelSparkel
Copy link
Author

BebeSparkelSparkel commented Aug 2, 2020

ADT sounds better. Allows a lot more functionality. Not sure what to name the function though unless we want to break margin

@github-actions
Copy link

github-actions bot commented Sep 7, 2021

This issue has not seen any activity in a long time. If no further activity occurs, it will be closed after ten weeks.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 27, 2024
@turion turion reopened this Oct 27, 2024
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

2 participants