-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
copyWithStyleproperty of typeStacTextStyle? has been introduced to bothStacTextandStacTextSpan. This allows for selectively overriding properties of a predefined base text style.Enhanced style merging behavior:
copyWithStyleproperty 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
_resolveStylemethod to merge style andcopyWithStylevalues into a singleTextStyle, giving priority to the override values fromcopyWithStyle.The
_buildTextSpanmethod now applies_resolveStyleto each child span, ensuring consistent style resolution.Example:
Related Issues
Closes #249
Type of Change