You are here

public function Builder::rootAttributes in GridStack 8.2

Provides inline styles specific for admin pages.

File

src/Plugin/gridstack/stylizer/Builder.php, line 93

Class

Builder
Provides Layout Builder integration for editor previews.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

public function rootAttributes(array &$attributes, array $styles) {
  if ($rules = $this
    ->parseStyles($styles, FALSE)) {
    $attributes['data-gs-inline-styles'] = Json::encode(reset($rules));
  }
}