You are here

public function GridStackStylizer::styles in GridStack 8.2

Parses the formatted styles per region based on settings.

File

src/GridStackStylizer.php, line 229

Class

GridStackStylizer
Implements GridStackStylizerInterface.

Namespace

Drupal\gridstack

Code

public function styles(array &$attributes, array $settings) {
  $styles = $this
    ->style()
    ->getStyles($settings);
  if ($styles && ($data = $this
    ->style()
    ->getSelector($settings, '', $styles))) {

    // Only inline it to DOM element if at LB edit pages.
    if (!empty($settings['_ipe'])) {
      $this
        ->builder()
        ->inlineAttributes($attributes, $data);
    }
    return $data;
  }
  return [];
}