Mobile Stylesheet selection compatible with Safari <3, or am I stuck with JS?


after considerable experimentation, settled on best mix of cleanliness , features serving mobile stylesheet iphones, android phones, , other small-screen devices, , full stylesheet desktop browsers being following:

set full stylesheet:
code:
media="screen , (min-device-width: 6in), projection"
and mobile one:
code:
media="only screen , (max-device-width: 6in), handheld"
... provide javascript button allow user override decision , enable/disable between them preferred one.

used min-device-width: 6in because catches android devices resolutions higher 480px. (though after experimenting, android unfortunately isn't close accurate on pixel density high-res screens, using 100ppi always--the eris, example, thinks has 5" screen. rather disappointing.)

works perfectly; ff, ie8 , safari 3 or greater, ipad full sheet, iphone , android devices mobile one, "only" @ beginning of mobile media declaration prevents older browsers touching it, , can switch cleanly between them.

except that, turns out, safari 2.0 or older not load stylesheets media commands "and" in them, if there isn't "only" @ beginning. since older safaris can handle css fine, don't want force them manually select stylesheet, can't see decent way around problem without either:

a) including antistyle sheet part of mobile style, pain , mess,
or
b) using javascript browser detector enable desktop sheet automatically.

, if i'm using js select anyway, i'm browser sniffing, can of worms hate open.

there i'm missing here, or out of luck on this?

test site, if wanted see specific implementation, is:
http://tinderbox.animeworld.com/reviews/


unrelated aside, after realizing ie6 has dropped below 5% of pageviews , decreasing rapidly, decided more efficient "screw it" , feed minimal stylesheet. first significant site i've done with--so liberating.
 

it's 2010 drop safari 2 support!

unless unlike other website on planet, you've got less 0% traffic coming site safari 2.0 - that's going os x 10.4 no safari updates applied - base install of tiger. highly unlikely.

on it, enjoy successful solution , kicks , giggles, install log parser let know when safari 2.0 browser come site - if ever should quite surprise when happen.
 


Forums Special Interests Web Design and Development


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments