That’s actually tricky.
I see you are using a div to create the triangle…In general I wouldn’t do that.
Use a pseudo element instead. You still come up with the same problem but you don’t have unnecessary HTML in your mark-up.
Why tricky…because to create the actual border you would need another triangle (white) inside/over the ‘outer’ triangle to mask it off.