Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Style's font/size is set to nil by default and not override previously set style; font owns attributes are applied only when font/size is explicitly set for Style #43

Closed
guzhenhuaGitHub opened this issue Aug 6, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@guzhenhuaGitHub
Copy link

I made styles like this:

let normal = Style { $0.font = UIFont.systemFont(ofSize: 8); $0.color = UIColor.black }
let red = Style { $0.color = UIColor.red }
let group = StyleGroup(base: normal, ["red": red])
"This font size is small, <red>This font size is big</red>".set(style: group) 

And the result is:
wechatimg22

Is this a preferred effect?

@malcommac malcommac changed the title The special tag's unspecified property are not inherit from base style in StyleGroup Style's font/size is set to nil by default and not override previously set style; font owns attributes are applied only when font/size is explicitly set for Style Aug 30, 2018
@malcommac malcommac self-assigned this Aug 30, 2018
@malcommac malcommac added the bug label Aug 30, 2018
@malcommac malcommac added this to the 2.0.2 milestone Aug 30, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants