This is what seven does:

function seven_form_node_form_alter(&$form, &$form_state) {
  /** @var \Drupal\node\NodeInterface $node */
  $node = $form_state['controller']->getEntity();

  $form['#theme'] = array('node_edit_form');
  $form['#attached'] = array(
    'css' => array(drupal_get_path('module', 'node') . '/css/node.module.css'),
  );
  ...

Expected is $form['#attached']['css'][] = ...

Will provide patch.

CommentFileSizeAuthor
#1 2300313-attached-1.patch713 bytesblueminds

Comments

blueminds’s picture

StatusFileSize
new713 bytes

Here comes the patch.

blueminds’s picture

Status: Active » Needs review
tim.plunkett’s picture

+++ b/core/themes/seven/seven.theme
@@ -273,9 +273,7 @@ function seven_form_node_form_alter(&$form, &$form_state) {
   $form['#theme'] = array('node_edit_form');
...
+  $form['#attached']['css'][] = drupal_get_path('module', 'node') . '/css/node.module.css';

This is the right fix.
But why is any of this in seven.theme at all? Why is it not part of node.module?

tim.plunkett’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Quick fix

Whatever, that can be a follow-up

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 91fb35e and pushed to 8.x. Thanks!

I guess that maybe node.module.css should be moved to seven since it contains media queries for different screen widths which is highly theme dependent

  • alexpott committed 91fb35e on 8.x
    Issue #2300313 by blueminds: Fixed Seven theme competely overrides the $...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.