title: Drupal 8 img as backgroundimage
body: <p>I'm making my own drupal 8 theme. This is the first time I use drupal. But I have the following problem: I would like to show the article's image as a background image. In Drupal 7 (I have found) you could do that with the following preprocessor, but how do you achieve this in drupal 8?</p>
  
  <pre><code>function THEME_preprocess_page(&amp;$vars) {
  $node = menu_get_object('node');
  if (!empty($node) &amp;&amp; !empty($node-&gt;field_background_image)) {
      $image = file_create_url($node-&gt;field_background_image[LANGUAGE_NONE][0]['uri']);
      drupal_add_css('div#content {background: url(' . $image . ') no-repeat scroll center center / cover #FCFCFC; }', array('type' =&gt; 'inline'));
  }
  }
  </code></pre>
  
  <p>Thank you</p>