You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Text would default to a dark color for the light theme and be visible.
Actual Behavior
Text is not a component, it is a primitive, which means it ignores the theme and renders white by default. The text ends up invisible.
The text inside the button is handled as expected and visible.
Additional Comments
After some discussion with Emilio I believe this works as intended but I'd say it doesn't work the way you'd expect. I think following the theme is the work of the component, not the primitive. But the default way of putting arbitrary text on the screen is using the primitive. So we get no good default for the theming. Would it be reasonable for text to pick up the theme for default text color?
I think there is a potential for UI developer incredulity at why text just doesn't respect the theme setting. Do we want a component that simply wraps text and does the theming? What is that called? A Label? A ThemedText?
The text was updated successfully, but these errors were encountered:
I took a brief look at it hoping I could throw a PR in here for that case. But I didn't quite follow where that piece of action would have to happen from my brief attempt.
If you could point me in the right direction I'd be happy to make a proof-of-concept we could consider.
This isn't so straight-forward. Text is just a primitive and thus doesn't have a natural place to add code telling to pick up the contents of a theme. Instead it just inherits whatever the current font styles are form above it in the graph tree.
Probably the best place is if a theme is set during the Graph.build(...) function, then extract and set the font styles. Assuming they are not already set explicitly by the dev.
Memory is fuzzy. May have already done this? Need to take a look.
Checklist
Versions and Environment
Elixir: 1.8.1-otp-21
Erlang: 21.2.2
Scenic: 0.10.0
OS: MacOS
Steps to reproduce
Expected Behavior
Text would default to a dark color for the light theme and be visible.
Actual Behavior
Text is not a component, it is a primitive, which means it ignores the theme and renders white by default. The text ends up invisible.
The text inside the button is handled as expected and visible.
Additional Comments
After some discussion with Emilio I believe this works as intended but I'd say it doesn't work the way you'd expect. I think following the theme is the work of the component, not the primitive. But the default way of putting arbitrary text on the screen is using the primitive. So we get no good default for the theming. Would it be reasonable for text to pick up the theme for default text color?
I think there is a potential for UI developer incredulity at why text just doesn't respect the theme setting. Do we want a component that simply wraps text and does the theming? What is that called? A Label? A ThemedText?
The text was updated successfully, but these errors were encountered: