In edit mode

Permalink
I have the following which works when the user is logged in but how do I get it to only work when they are actually in the edit mode on the page.

$cp = new Permissions($c);
 if($cp->canWrite() && $cp->canAddSubContent()){
  echo('<style type="text/css">.navbar{margin-top:50px;} body{margin-top:100px !important;}</style>');
   }

Responsive
 
Responsive replied on at Permalink Reply
Responsive
Found it

global $c;
if ($c->isEditMode()) {
  echo('<style type="text/css">.navbar{margin-top:50px;} body{margin-top:100px !important;}</style>');
}