How to add a UIStroke outlining the objects in a CanvasGroup?

Hello fellow developers,

Today I was designing a health bar for a game and was using a CanvasGroup. I have to use a CanvasGroup because the GUI uses multiple frames that overlap and are 0.5 transparent, so if I didn’t use a CG, the transparencies would be messed up.
Anyways, I was wondering how I could add a stroke to this. I can’t simply add a UIStroke to each frame, because then the strokes would overlap, like this:

image

So, how could I add a stroke for this kind of situation? I know it’s kind of an edge case, but that’s precisely why I posted here.

Thanks for the help in advance!
Fizzitix