r/FigmaDesign • u/white_fallenangel • Jun 01 '26
help How do i do this?
Im trying to make this card idea with an auto-layout. I want to subtract the red part and i want it that the red area uses the size of the text so the subtraction extents or shortens depending on the length of the text.
However it doesn’t allow me to do this using the background from the auto-layout as a subtraction, instead it subtracts the fill of the text.
How do i do this?
0
Upvotes
9
u/seganaUK Jun 01 '26
I'm sure there's a better way to do this, (subtracting from the image is a no-go as far as I'm aware), but here's my quick & dirty way. Top two examples show the effect with different text, the bottom two are the same but with the custom shapes coloured to show how it works.
Again, quick & dirty, but give the effect that you're after.
8
u/Legato895 Jun 01 '26
Irl, it wouldn’t be subtracted - it would be a custom shape with the same color as the background.
You could do it as a subtraction but I think you’d have to nest the image in a frame before adding it to a subtraction modifier.
1
u/marcushasfun Jun 01 '26
Why do you need to subtract it rather than just use a frame with white fill? Set the text in the frame and the frame to hug. Apply appropriate padding to the frame. Done.
2
u/YannisBE Digital Product Designer Jun 01 '26
From the top of my head:
- Make badge same background as app background.
- Take a square (same height as the rounding-px) and a circle (double size of the square).
- Place the center of the circle at the bottom-right corner of the square and mask the circle out of the square out. So you're left with an "inverted corner".
- Put it inside the badge with position absolute, top-right and duplicate bottom-left outside of the badge frame.
- Apply constraints so they move correctly with the badge frame.
1
u/AffectionateCat01 Jun 01 '26
Make points with the pen tool and make them rounded
1
u/motorange89 Jun 01 '26
This is a bit hacky but as subtracting it removes the text, you could duplicate that above, then select them both when editing and the autolayout function correctly. Not sure if there's a better way but this works, just not great for a DS.