Skip to content

Commit

Permalink
Added media="screen" — So print stylesheets are unaffected.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathansmith committed Feb 3, 2012
1 parent 89136f1 commit 230a885
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/js/adapt.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// <link rel="stylesheet" /> // <link rel="stylesheet" />
var css = d.createElement('link'); var css = d.createElement('link');
css.rel = 'stylesheet'; css.rel = 'stylesheet';
css.media = 'screen';


// Called from within adapt(). // Called from within adapt().
function change(i, width) { function change(i, width) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/adapt.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ <h2>
What is this? What is this?
</h2> </h2>
<p> <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>
<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. 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.
Expand Down

0 comments on commit 230a885

Please sign in to comment.