You are here

protected function BackgroundImageFormatter::generateCssString in Simple Background image formatter 8

1 call to BackgroundImageFormatter::generateCssString()
BackgroundImageFormatter::renderElements in src/Plugin/Field/FieldFormatter/BackgroundImageFormatter.php
Render image elements.

File

src/Plugin/Field/FieldFormatter/BackgroundImageFormatter.php, line 169

Class

BackgroundImageFormatter
Plugin implementation of the background_image_formatter.

Namespace

Drupal\background_image_formatter\Plugin\Field\FieldFormatter

Code

protected function generateCssString($theme) {
  return $theme['#background_image_selector'] . ' {background-image: url("' . $theme['#image_uri'] . '");}';
}