I've tried your suggestion but it didn't work here.
The code you sent was reformatted by Kentico:
{% if (PortalContext.ViewMode != "LiveSite") { %}
<style type="text/css">.cms-bootstrap .PortalContextMenu {
border-radius: 0;
box-shadow: 0 6px 12px rgba(0,0,0,.175);
background-clip: padding-box;
background: #403e3d !important;
}
</style>
{% } |(identity)GlobalAdministrator%}
Not sure if that's what caused it to not work. I did edit it a second time to match your post but it still got reformatted.
Iain