I often see the design with the rounded corners. But I haven't seen a live version yet. I would like to implement this myself but except before/after with inverse-border-radius I have no idea for the implementation.
Especially for headings I would be interested in this, where this adjusts automatically and 2 line headings are no problem. As seen with the button, just like to have a text paragraph.
Does anyone have an approach for this. Would be happy about help

there is no such thing as "negative border radius". If you know what background you will be using, you can mask it with some before/after elements: