toga icon indicating copy to clipboard operation
toga copied to clipboard

Support CSS font size keywords

Open peschwartz opened this issue 9 months ago • 11 comments

Added backend support for CSS font-size keywords to Android, Cocoa, iOS, GTK, and Windows and updated the core and travertino testing suites. Includes updated documentation.

Fixes #1814

PR Checklist:

  • [x] All new features have been tested
  • [x] All new features have been documented
  • [x] I have read the CONTRIBUTING.md file
  • [x] I will abide by the code of conduct

peschwartz avatar Mar 07 '25 10:03 peschwartz

Hello! We've made the changes to remove the xxxl size and the relative sizes. It passes all of the CI checks but for some reason, it is not passing the docs build. Any ideas as to why?

peschwartz avatar Mar 18 '25 20:03 peschwartz

Hello! We've made the changes to remove the xxxl size and the relative sizes. It passes all of the CI checks but for some reason, it is not passing the docs build. Any ideas as to why?

It looks like it might be related to RTD's recent switchover to their new management UI. Your original docs builds seems to have fallen into a crack somewhere; I've manually restarted the build, and it seems to have worked. Apologies for the confusion!

freakboy3742 avatar Mar 18 '25 21:03 freakboy3742

@mhsmith I've implemented the changes you suggested! Let me know if there is more we can do for this PR.

peschwartz avatar Apr 07 '25 18:04 peschwartz

@peschwartz Thanks for the update - @mhsmith and I are both travelling for work at the moment, so we're a little busy; we'll take a look as soon as we get a chance.

freakboy3742 avatar Apr 10 '25 10:04 freakboy3742

I'm not able to apply these changes because you didn't enable the "allow edits by maintainers" option. Please do that in future PRs.

Meanwhile, you don't need to do anything; I'll merge this branch by creating a separate PR.

mhsmith avatar Apr 14 '25 20:04 mhsmith

When testing on Android, I got this error:

E/AndroidRuntime: Caused by: com.chaquo.python.PyException: ModuleNotFoundError: No module named 'travertino.properties.shorthand'; 'travertino.properties' is not a package
E/AndroidRuntime:   at <python>.toga.style.pack.<module>(pack.py:40)
E/AndroidRuntime:   at <python>.toga.style.<module>(__init__.py:2)
E/AndroidRuntime:   at <python>.font_size.app.<module>(app.py:2)

And sure enough, travertino/properties/__init__.py does not exist. This is an oversight, and I'm not sure why it hasn't caused problems before, but you might as well fix it in this PR if you encounter it.

mhsmith avatar Apr 14 '25 21:04 mhsmith

And sure enough, travertino/properties/__init__.py does not exist. This is an oversight, and I'm not sure why it hasn't caused problems before, but you might as well fix it in this PR if you encounter it.

That is... shocking... how has that not caused problems? I can only presume it's because all the existing usage is from .properties.foo import ...?

freakboy3742 avatar Apr 14 '25 23:04 freakboy3742

Maybe it's been treated as an implicit namespace package, in which case Chaquopy's custom importer may be the reason why it fails on that platform. Still not sure why it isn't breaking the testbed as well, but it's not worth looking into any further.

mhsmith avatar Apr 15 '25 06:04 mhsmith

Hey @mhsmith,

We've looked at this: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork and we aren't seeing this option to allow you maintainer access. How do you think we should proceed? I can give you direct access to our repository if that works.

peschwartz avatar Apr 15 '25 08:04 peschwartz

It should be at the bottom of the right hand column, as shown in the screenshot on that page. If you can't see it, never mind, I can continue suggesting the changes to you, as we have been doing so far.

mhsmith avatar Apr 15 '25 09:04 mhsmith

Heads up that this and #3569 will inevitably conflict, so whichever gets merged second will have some conflicts to resolve. It looks like all of your changes to the backends are localized to just a few lines, though, so either way I don't think it should be too gnarly. 🤞

HalfWhitt avatar Jul 05 '25 05:07 HalfWhitt