-
-
Notifications
You must be signed in to change notification settings - Fork 77
feat: add copyWithStyle
property to StacText
.
#262
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
Conversation
Hey @Abdalqader27!! Thank you for this amazing PR. There are some formatting issues. Can you please check them? https://github.com/StacDev/stac/actions/runs/15293316177/job/43023165207?pr=262 |
You 're welcome @divyanshub024 , SOLVED |
@divyanshub024 now we 're good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution @Abdalqader27 🎉
Description
copyWithStyle
property of typeStacTextStyle
? has been introduced to bothStacText
andStacTextSpan
. This allows for selectively overriding properties of a predefined base text style.Enhanced style merging behavior:
copyWithStyle
property enables developers to build on top of existing styles (e.g., "labelMedium
") by overriding specific attributes such as color, font weight, or letter spacing, without redefining the entire style.Updated StacTextParser:
Introduced a
_resolveStyle
method to merge style andcopyWithStyle
values into a singleTextStyle
, giving priority to the override values fromcopyWithStyle
.The
_buildTextSpan
method now applies_resolveStyle
to each child span, ensuring consistent style resolution.Example:
Related Issues
Closes #249
Type of Change