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

feat: add ability to add text stroke #645

Merged
merged 6 commits into from
Nov 19, 2024

Conversation

AioiLight
Copy link
Contributor

@AioiLight AioiLight commented Nov 2, 2024

af8e1b7b-0c8a-4722-833c-df1b38b0df26

This PR is adding ability to stroke to texts.

fixes: #578

Added 2 properties (WebkitTextStrokeWidth, WebkitTextStrokeColor) and 1 shorthands (WebkitTextStroke). When stroke is enabled, paint-order: stroke; and stroke-linejoin: round; are automatically set to prevent the stroke from obscuring the text.

I don't have a deep understanding of all the code so further improvements may be needed.

Copy link

vercel bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
satori-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 5, 2024 3:54pm

@AioiLight AioiLight marked this pull request as ready for review November 3, 2024 14:20
@AioiLight AioiLight requested a review from shuding as a code owner November 3, 2024 14:20
Copy link
Member

@shuding shuding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you! We need some tests though (check out /tests).

@AioiLight
Copy link
Contributor Author

Sorry for the sudden change.
Since textStroke is not a valid property for ReactNode, I changed it to WebkitTextStroke, which is a non-standard CSS property name.
I have also added some tests, but the paint-order on the test does not seem to work well it depending on the version of resvg.

@AioiLight AioiLight requested a review from shuding November 6, 2024 22:23
@shuding shuding merged commit 1481902 into vercel:main Nov 19, 2024
5 checks passed
@shuding
Copy link
Member

shuding commented Nov 19, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support -webkit-text-stroke
2 participants