-
Notifications
You must be signed in to change notification settings - Fork 19
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
New theme #22
base: master
Are you sure you want to change the base?
New theme #22
Conversation
While this approach is simple, the main reason for style sheets to exist is dynamic widget state. A |
Forgive me but i don't understand why my rfc imply that pub struct ButtonColors {
pub background: Option<Background>,
pub border_color: Color,
pub text_color: Color,
}
// we could use a builder patter here
let colors = ButtonColors {
background: None,
border_color: color!(...),
text_color: color!(...),
};
Button::new("hello")
// this is just a setter.
.colors(colors);
we can then match the internal state to compute his appearance, based on his styling state |
I like the way flutter handles this (which in turn inspired Jetpack Compose). Each platform gets its own Theme object like TLDR: Current methods of style sheets are nice for implementing custom design language, but a base palette structure needs to be implemented in it so that they can be used for styling/creating custom widgets that follow the same theme. |
renderer