You are here

public function StyleBase::parseStyles in GridStack 8.2

Builds inline styles if so required with multiple instances on a page.

1 call to StyleBase::parseStyles()
Builder::rootAttributes in src/Plugin/gridstack/stylizer/Builder.php
Provides inline styles specific for admin pages.

File

src/Plugin/gridstack/stylizer/StyleBase.php, line 118

Class

StyleBase
Provides the base styles.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

public function parseStyles(array $styles, $stringify = FALSE) {
  $build = [];
  foreach ($styles as $id => $groups) {
    foreach ($groups as $rules) {
      foreach ($rules as $selector => $rule) {
        if ($stringify) {
          $build[$id][] = $this
            ->cssRule($selector, $rule, TRUE);
        }
        else {
          $build[$id][$selector] = $rule;
        }
      }
    }
  }
  return $build;
}