Skip to content

Commit 230a885

Browse files
committed
Added media="screen" — So print stylesheets are unaffected.
1 parent 89136f1 commit 230a885

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

assets/js/adapt.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// <link rel="stylesheet" />
2525
var css = d.createElement('link');
2626
css.rel = 'stylesheet';
27+
css.media = 'screen';
2728

2829
// Called from within adapt().
2930
function change(i, width) {

assets/js/adapt.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ <h2>
5050
What is this?
5151
</h2>
5252
<p>
53-
<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.
53+
<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.
5454
</p>
5555
<p>
5656
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 commit comments

Comments
 (0)