You are here

public function CheeseburgerMenu::formatBreakpoints in Cheeseburger Menu 8.4

Formats media query.

1 call to CheeseburgerMenu::formatBreakpoints()
CheeseburgerMenu::build in src/Plugin/Block/CheeseburgerMenu.php
Building block.

File

src/Plugin/Block/CheeseburgerMenu.php, line 518
Cheeseburger class extends BlockBase.

Class

CheeseburgerMenu
Block info.

Namespace

Drupal\cheeseburger_menu\Plugin\Block

Code

public function formatBreakpoints($breakpoints) {
  $breakpoints_theme = $this->renderCheesebugerMenuService
    ->returnBreakpointsForDefaultTheme();
  $media_query = [];
  if ($breakpoints['from'] == '0') {
    $media_query['from'] = '0';
  }
  else {
    $media_query['from'] = $breakpoints_theme[$breakpoints['from']]['mediaQuery'];
  }
  $media_query['to'] = $breakpoints_theme[$breakpoints['to']]['mediaQuery'];
  return $media_query;
}