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

add paint-order support #1862

Open
zhiqingchen opened this issue Sep 8, 2022 · 4 comments
Open

add paint-order support #1862

zhiqingchen opened this issue Sep 8, 2022 · 4 comments

Comments

@zhiqingchen
Copy link

Feature Request

add paint-order attribute

Why it is needed

The paint-order attribute specifies the order that the fill, stroke, and markers of a given shape or text element are painted.

Possible implementation

Maybe change the paint order when drawing?

Code sample

<svg xmlns="http://www.w3.org/2000/svg" width="400" height="200">
  <linearGradient id="g" x1="0" y1="0" x2="0" y2="1">
    <stop stop-color="#888"/>
    <stop stop-color="#ccc" offset="1"/>
  </linearGradient>
  <rect width="400" height="200" fill="url(#g)"/>
  <g fill="crimson" stroke="white" stroke-width="6" stroke-linejoin="round"
     text-anchor="middle" font-family="sans-serif" font-size="50px" font-weight="bold">
    <text x="200" y="75">stroke over</text>
    <text x="200" y="150" paint-order="stroke" id="stroke-under">stroke under</text>
  </g>
</svg>

image

@masterRokshi
Copy link

+1, this would be super great

@ajarian
Copy link

ajarian commented Dec 30, 2023

Adding another +1, trying to create outlined text right now and I'm hitting a wall without support for this prop 🙏

@shaquibimdad
Copy link

+1

@LuanNguyen-HnL
Copy link

+1

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

No branches or pull requests

6 participants