public static function preRenderToolbar($element) { // Get the configured breakpoints to switch from vertical to horizontal
// toolbar presentation.
$breakpoints =
static::
breakpointManager()->
getBreakpointsByGroup('toolbar'
);
if (!
empty($breakpoints)) { $media_queries =
[];
foreach ($breakpoints as $id =>
$breakpoint) { $media_queries[$id] =
$breakpoint->
getMediaQuery();
} $element['#attached'
]['drupalSettings'
]['toolbar'
]['breakpoints'
] =
$media_queries;
} $module_handler =
static::
moduleHandler();
// Get toolbar items from all modules that implement hook_toolbar().