This question has been answered by BobRay. See the first response.
<body class="whatever [[!addClass]]">
/* addClass snippet */ return $modx->user->hasSessionContext('web') ? 'YourAddedClass' : '';
$visibility = $modx->user->hasSessionContext('web') ? 'block' : 'hidden'; $css = ' .my_class { display: ' . $visibility . '; }'; $modx->regClientCSS($css);