Skip to content

feat: add ability to add text stroke #645

Merged
shuding merged 6 commits intovercel:mainfrom
AioiLight:supports-text-stroke
Nov 19, 2024
Merged

feat: add ability to add text stroke #645
shuding merged 6 commits intovercel:mainfrom
AioiLight:supports-text-stroke

Conversation

@AioiLight
Copy link
Copy Markdown
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.

@vercel
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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.

@shuding
Copy link
Copy Markdown
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