Permalink
Browse files

Added media="screen" — So print stylesheets are unaffected.

  • Loading branch information...
1 parent 89136f1 commit 230a88576683a64c2fb8823e14989d88a6f1c16d @nathansmith committed Feb 3, 2012
Showing with 3 additions and 2 deletions.
  1. +1 −0 assets/js/adapt.js
  2. +1 −1 assets/js/adapt.min.js
  3. +1 −1 index.html
View
@@ -24,6 +24,7 @@
// <link rel="stylesheet" />
var css = d.createElement('link');
css.rel = 'stylesheet';
+ css.media = 'screen';
// Called from within adapt().
function change(i, width) {
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -50,7 +50,7 @@ <h2>
What is this?
</h2>
<p>
- <a href="https://github.com/nathansmith/adapt/blob/master/assets/js/adapt.js">Adapt.js</a> is a lightweight (831 bytes <a href="https://github.com/nathansmith/adapt/blob/master/assets/js/adapt.min.js">minified</a>) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.
+ <a href="https://github.com/nathansmith/adapt/blob/master/assets/js/adapt.js">Adapt.js</a> is a lightweight (848 bytes <a href="https://github.com/nathansmith/adapt/blob/master/assets/js/adapt.min.js">minified</a>) JavaScript file that determines which CSS file to load before the browser renders a page. If the browser tilts or resizes, Adapt.js simply checks its width, and serves only the CSS that is needed, when it is needed.
</p>
<p>
A potential drawback of Adapt.js is the possibility of a brief flash of unstyled content as a new stylesheet is being fetched (think of it as “Ajax” for CSS). I have done my best to mitigate this by keeping CSS files small (3 KB). It is worth noting this is a proposed, not prescribed, approach to a problem with multiple solutions.

0 comments on commit 230a885

Please sign in to comment.