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

Specifying style can be a bit wordy #49

Open
sakuraehikaru opened this issue Apr 25, 2023 · 1 comment
Open

Specifying style can be a bit wordy #49

sakuraehikaru opened this issue Apr 25, 2023 · 1 comment
Assignees

Comments

@sakuraehikaru
Copy link

sakuraehikaru commented Apr 25, 2023

For example:
DetailText(equity, style: Config.current.detailTextStyle.with(color: .platinum))

It would be nice to find a way to write something like:
DetailText(equity, style: .color(.platinum))

Where the default behaviour is to use Config.current plus the corresponding style, and we only specify what's different; in this case just the color.

@AZielinsky95
Copy link
Contributor

There's a convenience initializer in NiceText to do this so you just have to specify: DetailText(equity, color: .platinum)

https://github.com/steamclock/nice_components/blob/96b0862a43ee54bc5327a6d87323f177690583b3/Sources/NiceComponents/Text/NiceText.swift#L41

@sakuraehikaru sakuraehikaru self-assigned this Apr 25, 2023
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