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

Rewrite overflow and overflowWrap using phantom types approach #400

Merged
merged 4 commits into from
Apr 17, 2018

Conversation

juanedi
Copy link

@juanedi juanedi commented Apr 16, 2018

Restored properties:

  • overflow
  • overflowX
  • overflowY
  • overflowWrap

Copy link
Owner

@rtfeldman rtfeldman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change, then this looks good to go!

src/Css.elm Outdated
overflow auto

-}
overflow : Overflow -> Style
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd actually prefer to inline the types rather than using type aliases for functions like these. (In fact, I wouldn't even define the type alias Overflow!)

The reason for this is that this way, if you give overflow a value it doesn't accept, the compiler error message will list all the values that are permitted. (e.g. visible, hidden, etc.)

Sorry this wasn't clear!

Copy link
Author

@juanedi juanedi Apr 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure that was clear when I read it, but just wasn't present in my mind when I was writing the code :-)

Thanks for the review! Should be fixed now.

Value "hidden"


{-| The `visible` value used for properties such as [`visibility`](https://css-tricks.com/almanac/properties/v/visibility/), [`overflow`](https://css-tricks.com/almanac/properties/o/overflow/) and [`pointer-events`](https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the detail on these docs! 😻

@rtfeldman rtfeldman merged commit 7ac79f4 into rtfeldman:phantom-types Apr 17, 2018
@rtfeldman
Copy link
Owner

Awesome, thanks @juanedi!

@juanedi juanedi deleted the phantom-types--overflow branch April 17, 2018 15:48
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

Successfully merging this pull request may close these issues.

2 participants