Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Contributing: use implicit attr=true #90

Closed
joshq00 opened this issue Oct 18, 2015 · 4 comments
Closed

Contributing: use implicit attr=true #90

joshq00 opened this issue Oct 18, 2015 · 4 comments

Comments

@joshq00
Copy link
Contributor

joshq00 commented Oct 18, 2015

Want to open discussion on using the implicit attr=true syntax

Example:

<Button raised accent disabled>
// vs
<Button raised={ true } accent={ true } disabled={ true }>

As HTML generally accepts the former, and is much less verbose, I think having the implicit form would be appropriate

@faergeek
Copy link
Contributor

👍

@joshq00
Copy link
Contributor Author

joshq00 commented Oct 18, 2015

Another reason I can see this being very useful is, when doing a quick code scan, singling out true vs false will be much easier.

<Button colored={ true } ripple={ false } accent={ true }>
// vs
<Button colored ripple={ false } accent>

If changed, a separate discussion is whether "true" should be the default value for anything. Considering <Button ripple> makes it very clear that we are adding functionality rather than <Button ripple={ false }> to turn it off

@tleunen
Copy link
Owner

tleunen commented Oct 18, 2015

I agree with removing the boolean values in jsx. I was forcing them in personal projects but the more I use them, the more I want them removed as well.

But yes, it would mean that all booleans should be false by default.
The only one that isn't false is the ripple effect, because I think people usually add it since it's part of the MDL so I thought I could save that to users

@tleunen
Copy link
Owner

tleunen commented Oct 18, 2015

I did a first step which removes the boolean when it's true. I'll change the default for the ripple later.

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

No branches or pull requests

3 participants