The [`mdframed`](https://ctan.org/pkg/mdframed) package is rather limiting and not to pretty. There is a new player in town: [`tcolorbox`](https://ctan.org/pkg/tcolorbox), that could be a contender.