-
-
Notifications
You must be signed in to change notification settings - Fork 872
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
Honouring the app's theme #303
Comments
@edwardaux My buddy @Sub6Resources left me with this library before taking off on a 2 year humanitarian trip, so if it was expected to be released in 1.0.0 and you are finding cases it definitely isn't, then it must definitely not be, and must have been a mistake to close the issue. Is the theming problem solely based around text, or are there other problems? Will this be addressed in your other PR for accessibility and scaling? |
Sadly, now that I know a bit more about things, I don't think they're related (well, any mention I make of "scaling" is related to #308, but the default theming is a separate problem. I'll have a poke around and see what I can see. |
@edwardaux Is this still an issue? Or is it part of #308? |
Actual bugs are probably resolved by #308. As for following the app theme, I am not sure we should. HTML has well-defined standards that we rely upon (like a browser) would, instead of adopting the app theme. I think with the currect styling support we should have enough tools for a developer to easily set up a theme for |
FWIW, I do disagree - not that that means you're obliged to make any changes of course 😄 My thinking here is purely about the cognitive load of getting up and running with this library. The way I see things are that this library can be used in two main ways:
Perhaps you could consider creating a style that represents the equivalent of the app's current theme and make that as a readily discoverable static variable in the Personally, I'd advocate for this to be the "default" style, but I imagine there may be others that disagree. |
I do think in the first way, where this library is rendering just bits of content (and not be a web browser). It's tricky... because your argument makes sense, but I also want to prevent that for people that use standard-compatible styling to get drastically different results than people that don't. But we shoudl discuss on this, because you make lots of sense. |
@edwardaux what would be some things that you'd like to see "inherited" from the app theme? Just trying to get a better idea of your use case - I assume things like font family, colors, etc? Currently the app uses I wouldn't be opposed to including a "defaultTheme" parameter on the |
Yeah, that's pretty much the idea I had. It has been a while since I've dabbled in this space, but if I look at the code that I'm using at the moment, this is how I construct my
In my case, my HTML was super simple so this is all I needed, but I imagine there's a few other properties from the theme that could be populated initially. Don't get me wrong, it isn't that hard for devs to use something like the above, but as a newcomer to this library, it was something I was surprised wasn't the default behaviour. |
I see. I guess the only thing is that this would likely be quite a bit of hardcoding, right? Since you have to essentially manually set Again, I don't know how feasible this would be now that I look at it again since (I think) it requires some hardcoding, and if theming changes between Flutter versions, it could potentially break the widget or deprecate parts of the code. If there's a better way to do this then let me know! I am definitely not an expert in Flutter/Dart so I could be missing something. |
I looked through the various properties in |
Firstly, just wanted to say this is a cracking library! This is by far the best library in this space. Thank you!
One thing that I've noticed is that the default styling doesn't seem to follow the app's theme (although #18 seems to suggest that it does). Also, something that seems related is how it scales the text based on the user's device accessibility settings. Consider this super-simple app:
This results in the following:
<p>
tag are scaled at different sizes (not sure why)<p>
tag take's about 25% of the screen height, and text inside a<p>
tag is about 80% of the screen heightIf I explicitly assign a style like this:
it looks a bit better initially (in that the styles seem to match), however a) I would have thought this would be the default behaviour, and b) the scaling still doesn't match the standard text components.
I'm happy to look at creating a PR to resolve this if you can point me in the right direction.
Thanks again for a great library 🎉
The text was updated successfully, but these errors were encountered: