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
Toga's style engine has a (largely undocumented) concept of SYSTEM_FONT_SIZE - the default font size for text on the platform. It should also expose a selection of system colors that can be used.
Describe the solution you'd like
Most platforms have a palette of "standard" colors - primary, secondary (, tertiary...) text color, hyperlink color, border color etc. Toga should determine a reasonable subset of "common" system colors, expose those as constants through Pack, and modify color handling so that if a "system" color is requested, a platform appropriate color is used.
This likely means defining constants like toga.colors.SYSTEM_PRIMARY_TEXT that can be mapped to platform-specific shades.
Interestingly, CSS has a specification for this - but they've been deprecated. This seems to be because in the HTML context, the potential for HTML pages to spoof actual system dialogs etc is dangerous - but in our case, that's what we're trying to do. It might make sense to use these constants (or a subset of them), even though they've been formally deprecated from the standard.
Describe alternatives you've considered
Status quo - the system colors will be used if there's no explicit color provided, but it doesn't provide any way to use those colors in a different context.
What is the problem or limitation you are having?
Toga's style engine has a (largely undocumented) concept of
SYSTEM_FONT_SIZE
- the default font size for text on the platform. It should also expose a selection of system colors that can be used.Describe the solution you'd like
Most platforms have a palette of "standard" colors - primary, secondary (, tertiary...) text color, hyperlink color, border color etc. Toga should determine a reasonable subset of "common" system colors, expose those as constants through Pack, and modify color handling so that if a "system" color is requested, a platform appropriate color is used.
This likely means defining constants like
toga.colors.SYSTEM_PRIMARY_TEXT
that can be mapped to platform-specific shades.Interestingly, CSS has a specification for this - but they've been deprecated. This seems to be because in the HTML context, the potential for HTML pages to spoof actual system dialogs etc is dangerous - but in our case, that's what we're trying to do. It might make sense to use these constants (or a subset of them), even though they've been formally deprecated from the standard.
Describe alternatives you've considered
Status quo - the system colors will be used if there's no explicit color provided, but it doesn't provide any way to use those colors in a different context.
Additional context
See #2830 for the original request.
The text was updated successfully, but these errors were encountered: