Jump to content

Display border around code block in edit mode only

Go to solution Solved by creedon,

Recommended Posts

I often use code blocks to set anchors on a page, however, since they are not visible, it can be frustrating searching around to find them again. I would like the code block to be visible when I am in edit mode, but otherwise not visible. Here is the code I tried without luck:

/*
 ** display border around code blocks in edit mode only **
*/

body:not(.sqs-edit-mode) .source-code
{
  display: none !important;
  opacity: 0 !important;
}
body.sqs-edit-mode .source-code
{
  display: flex !important; 
  border: 1px solid red !important;
  opacity: 1 !important;
}

Thanks.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.