What's the right way to use different styles/scripts in Meteor depending on browser -
i'm using meteor build site has different css , scripts (jquery mobile) mobile devices desktop browsers. i'd able conditionally include these in head element based on user agent. i'm sure can dynamically injected dom, there meteor best practice kind of thing?
i suggest adding browser specific class body element (client/lib/environment.js
):
if(navigator.useragent.indexof("trident/4")>-1) $("body").addclass("ie8");
i use less , have ie8.less file so:
.ie8{ //override normal styles here - may have use !important }
this doesnt meet goal of loading what's applicable each client, fit bill browser specific styles
if files externally stored , using meteorite, maybe use https://atmosphere.meteor.com/package/external-file-loader detect , load needed scripts
however, if store files in meteor app, they've been combined , sent browser
Comments
Post a Comment