Created
January 27, 2016 20:03
-
-
Save RainbowArray/e63dfd34943fdefdf80a to your computer and use it in GitHub Desktop.
Change meta viewport tag in D8
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_HOOK() for HTML document templates. | |
*/ | |
function THEMENAME_preprocess_html(&$variables) { | |
foreach ($variables['page']['#attached']['html_head'] as $key => $value) { | |
if ($value[1] === 'viewport') { | |
$value[0]['#attributes']['content'] = 'width=device-width,minimum-scale=1,initial-scale=1'; | |
$variables['page']['#attached']['html_head'][$key] = $value; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment