Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Refactor Text component and typography handling (#585)
### TL;DR Improved text style handling and simplified Text component parameters. ### What changed? - Removed redundant `fontFamily` parameter from Text component overload - Added explicit handling of `LocalTextColor` with fallback to theme's `onSurface` color - Introduced separate `textStyle` and `textColor` variables for clearer style composition - Modified style merging to use `copy()` for more explicit property updates ### Why make this change? When the Text API is used inside a Button, it will provide a composition local style for text and color, which should be respected by the Text component. However, Text can also be used independently, requiring a style parameter. If we provide a style parameter, users might misuse it within a Button. To address this, we are merging and giving higher priority to the composition local text and color styles, then falling back to the provided parameters. This ensures consistency and prevents misuse.
- Loading branch information