tolo / InterfaCSS

The CSS-inspired styling and layout framework for iOS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UIButton label is styled by UILabel style and cannot be overridden (apparently)

TadeasKriz opened this issue · comments

Stylesheet:

Label {
    font: AFont 15;
}

UIButton {
    titleLabel.font: BFont 20;
}

Will yield a button with a label with font AFont 15 instead of BFont 20. The order of style does not matter unfortunately. Or is this something that cannot be fixed?

Yes, this is indeed a problem (with how setting properties on child objects currently works), but a problem that can be fixed. In fact, I'm working on a solution now, in the development branch for the next release, that I'm hoping will fix this. But for now, you have to work around the problem, for instance by doing something like this:

UIButton > UILabel {
    font: BFont 20;
}