Situation
- custom module adding styles
- don't add styles to node editing form
How to avoid adding the style to the editing forms?
function crossfade_page_attachments(array &$page) {
$page['#attached']['library'][] = 'crossfade/crossfade';
}
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.
Sign up to join this communityCurrently discovered answer derived from the metatag module)
function crossfade_page_attachments(array &$page) {
if (\Drupal::service('router.admin_context')->isAdminRoute()) {
return FALSE;
}
$page['#attached']['library'][] = 'crossfade/crossfade';
}