Skip to content
This repository has been archived by the owner on Mar 30, 2021. It is now read-only.

Commit

Permalink
Added inline SVG feature detection and use it for webkit fallbacks.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlr committed Feb 28, 2011
1 parent 2e6ca1e commit 0995a5c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mobile.css
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ header #home {
padding: 14px 0;
line-height: 14px;
}
.no-inlinesvg header #home {
background: transparent url(../global/mobile/homeicon.png) no-repeat 0 12px;
padding-left: 22px;
}
.mini-header .site-title a {
font-size: 22px;
line-height: 22px;
Expand Down Expand Up @@ -420,6 +424,7 @@ a.listview:before {
}

#search button[type=submit] {
display: block;
margin: 0;
height: 45px;
width: 56px;
Expand All @@ -434,6 +439,10 @@ a.listview:before {
vertical-align: middle;
}

.no-inlinesvg #search button[type=submit] {
background: transparent url(../global/mobile/searchbtn.png) no-repeat left top;
}

/************************************/
/* FOOTER */
/************************************/
Expand Down
Binary file added mobile/homeicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mobile/searchbtn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions mobilefeatures.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* In general we assume modern on the mobile site. We don't need full
* modernizr, but there are features we want to test for.
*/

// Tests below are copied from Modernizr
/*!
* Modernizr v1.7
* http://www.modernizr.com
*
* Developed by:
* - Faruk Ates http://farukat.es/
* - Paul Irish http://paulirish.com/
*
* Copyright (c) 2009-2011
* Dual-licensed under the BSD or MIT licenses.
* http://www.modernizr.com/license/
*/


(function() {

"use strict";

// Inline SVG is not in iPhone or Android webkit _yet_, so we need to fallback.
function inlineSVG() {
var div = document.createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == 'http://www.w3.org/2000/svg';
}
if(!inlineSVG()) {
document.documentElement.className += ' ' + 'no-inlinesvg';
}

}());

0 comments on commit 0995a5c

Please sign in to comment.