Skip to content

Instantly share code, notes, and snippets.

@ihorduchenko
Created September 9, 2017 19:52
Show Gist options
  • Save ihorduchenko/dd16e74ac3e04c185ecba2767f26317d to your computer and use it in GitHub Desktop.
Save ihorduchenko/dd16e74ac3e04c185ecba2767f26317d to your computer and use it in GitHub Desktop.
Load styles if IOS
var isMobile = (/iPhone|iPad|iPod/i.test(navigator.userAgent));
if (!isMobile) {
(function() {
var css = [
'./path/to/file.css'
],
i = 0,
link = document.createElement('link'),
head = document.getElementsByTagName('head')[0],
tmp;
link.rel = 'stylesheet';
for(; i < css.length; i++){
tmp = link.cloneNode(true);
tmp.href = css[i];
head.appendChild(tmp);
}
})();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment