Skip to content
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

Migrate style property syntax in docs #3138

Open
HalfWhitt opened this issue Jan 29, 2025 · 1 comment
Open

Migrate style property syntax in docs #3138

HalfWhitt opened this issue Jan 29, 2025 · 1 comment
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!

Comments

@HalfWhitt
Copy link
Contributor

What is the problem or limitation you are having?

With #3107 merged, style properties can be set directly on widgets, even in constructors. Currently, all the docs and examples are shown setting them explicitly via widget.style, with a note added to the bottom of base Widget explaining that one can also access them directly.

Describe the solution you'd like

Since the motivation is not only less typing but also simplicity for beginners, it would probably be best if this were flipped — use the newly added syntax most places, with a separate explanation of the underlying mechanism. It might still be worth using the "old" way in some places — with an explanation, or link to one — if it shows something useful, like reusing the same set of properties on several widgets.

Describe alternatives you've considered

All the code shown still works just fine.

Additional context

No response

@HalfWhitt HalfWhitt added the enhancement New features, or improvements to existing features. label Jan 29, 2025
@freakboy3742 freakboy3742 added the good first issue Is this your first time contributing? This could be a good place to start! label Jan 30, 2025
@freakboy3742
Copy link
Member

Agreed this would make sense. We should keep a couple of "old style" examples kicking around, but agreed that the overall focus of Toga's examples should be the new syntax. Depending on the discussion around #3134, that might involve some related work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. good first issue Is this your first time contributing? This could be a good place to start!
Projects
None yet
Development

No branches or pull requests

2 participants