Import media queries from a theme or module and create a default group.
string $group_name: Machine readable name of the breakpoint group.
string $label: Human readable name of the breakpoint group.
string $source_type: Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE.
array $media_queries: An array of breakpoints in the form $breakpoint['name'] = 'media query'.
function _breakpoint_import_media_queries($group_name, $label, $source_type, $media_queries) {
if (!empty($media_queries)) {
// Create a new breakpoint group if it doesn't exist.
$breakpoint_group = _breakpoint_group_create_or_load($group_name, $label, $group_name, $source_type);
// Load all media queries, create a breakpoint for each one and add them
// to this breakpoint group.
foreach ($media_queries as $name => $media_query) {
$breakpoint_group
->addBreakpointFromMediaQuery($name, $media_query);
}
$breakpoint_group
->save();
}
}