I am at the moment using a bit of javascript to modify the Meta viewport tag. Right now it's doing a simple detection of the userAgent, however I'd like to do it based on screen width size (breakpoints) to better target all mobile devices, etc. How would I go about this? Sample code below!
<meta id="viewport" name='viewport'>
<script>
(function(doc) {
var viewport = document.getElementById('viewport');
if ( navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) {
viewport.setAttribute("content", "initial-scale=1.0");
} else if ( navigator.userAgent.match(/iPad/i) ) {
viewport.setAttribute("content", "initial-scale=0.65");
}
}(document));
</script>