I’ve been trying to figure out how to make a custom shape in CSS that visually will look like this:

With the property of background:rgba(44, 44, 48, 0.9) and border:6px solid rgba(29, 30, 35, 0.9);
My problem is that I cannot find a way to make the top-right and bottom-left border look like the image I provided. Tried the tips on CSS Custom Shape on CSS-Tricks but it doesn’t seem to solve the problem as it cannot have background. Any ideas?
Unfortunately you cannot have a pseudo-element added to a pseudo-element (i.e.
:after:after{}will not work) – with a complex shape like yours, you might have to cheat a little and rely on pseudo-elements of its children.Again, this fiddle shows you how it would work with solid colors (reasonably well, although I don’t like the “thinner” angles) – but this would fail when you apply opacity. Your best would probably be around having “dog ears” made into pre-rendered semitransparent PNGs, for extra credit you could base64-encode them.
The “solution” above is a complete semantic horror though – you may have better luck using multiple backgrounds with pre-rendered graphics.