Last active
November 1, 2017 20:14
-
-
Save Quilted/13af94eb02daf14d23ab to your computer and use it in GitHub Desktop.
Omega 4 media query and breakpoints files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implements hook_preprocess_html(). | |
*/ | |
function THEMENAME.preprocess_html(&$variables) { | |
// Load the matchMedia polyfill. | |
if (module_exists('picture') && drupal_get_library('picture', 'matchmedia')) { | |
$options = array('group' => 'THEMENAME'); | |
// Load the mediaquery behavior from Omega. This allows registering media | |
// queries via Drupal.settings to automatically print body classes based on | |
// whether or not they currently apply. | |
$omega = drupal_get_path('theme', 'omega'); | |
drupal_add_js("$omega/js/omega.mediaqueries.js", $options); | |
// Register the media queries. The array keys will be used to compose the body | |
// class names and the values are the actual media queries. | |
drupal_add_js(array('omega' => array('mediaQueries' => array( | |
'mobile' => 'all', | |
'narrow' => 'all and (min-width: 740px)', | |
'normal' => 'all and (min-width: 980px)', | |
'wide' => 'all and (min-width: 1220px)', | |
))), 'setting'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment