Skip to content

Fix fontWeight binding (make it an abstract type) #776

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

Merged
merged 1 commit into from
Oct 20, 2022
Merged

Conversation

cknitt
Copy link
Member

@cknitt cknitt commented Oct 18, 2022

Closes #775

@cknitt cknitt requested a review from MoOx October 18, 2022 15:05
Copy link
Member

@MoOx MoOx left a comment

Choose a reason for hiding this comment

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

Nice. Sorry, I didn't had time to look for ideas as my life is a mess ATM :)
I guess we don't have much choice until syntax allow this.
Just thinking what user will have to do...
Previously style(~fontWeight=#_100, ()) & now style(~fontWeight=FontWeight._100, ()), that's correct ?

Since there is not a lot of value, why not just putting those directly at the root of Style module ?
If opened, this means people can do style(~fontWeight=_100, ()).

@cknitt
Copy link
Member Author

cknitt commented Oct 18, 2022

Yes, that's correct.

I am not in favor of putting things directly into Style because:

  • Conceptually, these constants clearly belong to FontWeight; Style._100 seems weird compared to Style.FontWeight._100.
  • If we get another property later that also needs a constant normal, we'll have a name clash.
  • We are already doing it the same way with ActivityIndicator.Size.small (not ActivityIndicator.small).

@MoOx MoOx merged commit 44885db into main Oct 20, 2022
@MoOx MoOx deleted the fix-font-weight branch October 20, 2022 20:57
@MoOx
Copy link
Member

MoOx commented Oct 20, 2022

Not a fan (too verbose for me), but I guess you are right.

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.

fontWeight broken in master
2 participants