Hi,
Easiest thing to do would probably be to add a specific class when you are the CMS. You can do so
By checking if the current request PageBuilder in edit mode by:
HttpContext
.Kentico()
.PageBuilder()
.EditMode;
Have a look at this blog from MVP Sean where he explains more details:
dev.to/...determining-a-request-s-page-builder-mode
You still have to adjust your css based on that class.