Code Monkey home page Code Monkey logo

css-inapplicable-load's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-inapplicable-load's Issues

what about inapplicable links inside iframes?

This is awesome stuff Scott. Keep it goin' on.

It might be useful to further define how browsers handle inapplicable media queries inside iframes. Presumably the parent layout has to be complete before the iframe's viewport is defined, and thus available for load decisions? This has already come up in the FF bug discussion, and it might to useful to know exactly what's happening cross-browser.

A possible workaround to prevent IE downloading inapplicable CSS

I've been looking into this on and off for the last couple of days since stumbling across the repo. One possible solution I'm testing to prevent IE8 and lower from downloading inapplicable CSS is to use the following:

<!--[if ! lte IE 8]>-->
<link rel="stylesheet" type="text/css" media="only screen and (min-width: 320px)" href="css/style.css" />
<!--<![endif]-->

<!--[if (gte IE 6)&(lte IE 8)]>
  <link rel="stylesheet" type="text/css" media="all" href="css/ie.css" />
<![endif]-->

It's fairly straightforward. Tell every browser but IE8 and lower to download the media queried CSS and then load up a separate file for IE8 and lower using the reverse of the same technique we're all familiar with.

I've tested the above in IE8 using browserstack and firebug to determine what stylesheets were downloaded and it appears to work.

For all I know this is a well known solution but maybe it might help someone. It may require more definitive testing.

Alternative immediate CSS load that is non-blocking for IE10+

http://jsbin.com/agEREDo/2

is an example that eagerly loads CSS but doesn't block the page rendering on IE9, IE10, IE11, recent Firefox, Chrome, Chrome Android, iOS. It works correctly on IE6, IE7, IE8 but no early loading (page is slow to render).

Same example as above with some extra xmlhttp logging to the proxy (interferes with and slows page load, but shows interesting timing information): http://jsbin.com/EPEdUXeX/4 Both are based on this experimentation page http://jsbin.com/OFeKabIY/29 (which may crash on IE8...).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.