-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert mobile-first media queries and remove respond.js #816
Comments
IMO the mobile first approach might be better suited to the mobile boilerplate |
Agreed ^. |
I almost never used mobile-first approach for a site with many JS-heavy components and various layout; for a portfolio site or blog, maybe mobile-first could be an approach. It's defintely not a default in my opinion. It's ok to have it in mobile boilerplate because it has a mobile focus. |
I know the general grumblings around are supposed to be 'write mobile first', but I can't get my head around writing for mobile when the testing tools are so well tooled for the desktop currently. +1 for removing respond. If you need to build a mobile-version of your site, you can stick the media queries in yourself or use some htaccess to push the user to the appropriate mobile page (built with mobile boilerplate), it's really too-specific to the use-case for the general nature of H5BP. |
Care to elaborate on that? Soon there will be more mobile Internet users than desktop users — in some countries this shift has already happened. I agree it’s a bit awkward to get used to this (since we’re all used to develop for “desktop first”), but I can’t help but feel mobile first is the direction we need to go in. We’ll have to adapt to the large number of mobile surfers eventually. |
It's pretty easy to switch between either approach to development. Just switch the placeholder MQs to use Maybe it's worth separating "mobile" from "narrow viewport". What we've got as the starting point in H5BP is narrow-viewport-first (although, as mentioned, it's trivial to switch back to wide-viewport-first). One of the benefits of the narrow-viewport-first approach is that it is a continuation of "progressive enhancement" and provides a simple way to ensure that your content is widely accessible, if not optimised. Older browsers are naturally shielded behind media queries from your more complex layout styles. However, since people want IE6-8 to receive more than this base style, you burden those already-weak browsers with extra JS in the form of a MQ (and other) polyfills. I'm not sure how much of a penalty this turns out to be for those browsers. It's one thing to design for mobile first. It's quite another to try and use one front-end code base to cover fully-fledged, optimised experiences on all devices and built up from narrow viewports first. Easier for simple sites, pretty hard for more complex ones. It's a delicate dance of writing your HTML primarily for wider viewports while writing your CSS to start from a narrow viewport perspective...not to mention the JS. That's quite apart from the ease-of-maintenance issue and the work that you might have to put into modifying images and other bandwidth-hungry assets if you're fully committing to this approach. There are going to be times when the "mobile" context is going to demand tailored content and design that diverges significantly from what is served in non-mobile contexts. Basically, a dedicated "mobile website". That is beyond the scope of the H5BP project and just using media queries. But if we remove all the narrow-viewport-first stuff by default, we risk opening the door for people to build H5BP bolt-ons to enable it. Some of those that have cropped up in the past were not properly tested or maintained. I don't think that is very good for the community. So I guess I'm not opposed to leaving the narrow-viewport-first MQs in there by default (as they are only placeholders). Simple sites can make good use of the approach, while developers working on larger sites will make their own choice. But perhaps we should pull Respond.js out of Modernizr and into its own file to give people clearer control over its inclusion in the project?
The Mobile Boilerplate is geared around providing a starting point for mobile webapps. So it's not really that you switch to the Mobile Boilerplate if you want to develop "mobile first". You can still use the HTML5 Boilerplate.
Browser UA string sniffing? This is a pretty flakey approach.
It's not too specific at all. We're just not convinced that it is practical for more complex sites. |
This stemmed from an emerging belief that all CSS polyfills are a decent amount of trouble in the hands of a great developer, and lots of trouble in the hands of a less experienced one. From a perf standpoint, they seem very similar to
What I think is a good rule of thumb is.. if you can lazily initialize the polyfill (after DOMContentLoaded) with a reasonable UX (not keeping the page invisible until its ready), then you're good. Otherwise I think the perf overhead is too significant. Clearly we're low on hard data here, though. :/ |
fwiw todd (filament group) believes WP7 (not mango) was the only mobile device to require respond: https://twitter.com/#!/toddmparker/status/126325865561866241 |
Can WP7 users upgrade to 7.5? Or do we need to wait for those devices to leave the ecosystem before IE7-on-mobile is no more? |
Argument from the other side.. http://www.slideshare.net/bryanrieger/rethinking-the-mobile-web-by-yiibu slides 87-101 |
I don't know about you guys, but I've had quite a bit of trouble getting even a single desktop emulator for any mobile browsing testing to work for me. Oh, uh, that may be because I'm on linux, but yeah, it's a pretty tricky problem anywhere, I expect (testing on the desktop as if you were browsing on android required setup of a weird virtualmachine that had major performance issues for me, and I didn't find any way to replicate iOS). As such, I haven't been able to approach h5bp from a mobile first perspective, only from a narrow-width perspective by silly things like decreasing the browser width and such. So I'd love to hear how you guys approach this problem if you're doing so successfully. For lowly me, mobile first is effectively a no-op. |
PPK is tracking media query support here: http://www.quirksmode.org/mobile/tableViewport.html#mediaqueries
I'm going to modify the second point: "Secondly, it's a little awkward at first, as a developer, to write your styles mobile first." That addition of at first is important. We're right now in the middle of a massive transition away from the desktop and towards a mobile future. The writing is on the wall. It requires changing the way we think. We've artificially created an "ideal" width for our websites in order to maintain control. It's been an assumption that's been a convenience for designers and developers alike. However, the desktop-first approach falls apart pretty quickly. Take this example: .section {
width: 50%;
float: left;
}
@media screen and (max-width: 600px) {
.section {
width: 100%;
float: none;
}
} By assuming desktop-first we introducing unneeded complexity into the code. Here's the mobile-first version: @media screen and (min-width: 600px) {
.section {
width: 50%;
float: left;
}
} Much better. Instead of having to override desktop styles, you simply define properties as they're needed. It's more efficient and way easier to maintain. "Mobile-first" in my humble opinion is much more a mental thing than it is a technical technique. It's another extension of progressive enhancement. We don't automatically assume geolocation, accelerometer and touch event support in browsers; we detect for their presence then act accordingly. We need to apply that same logic to something as simple as screen width (and to other comfortable assumptions like connection type). The "user is totally on a desktop" assumption needs to die as soon as possible in order for the web (as viewed through a browser) to continue to be viable in our mobile future. |
Correct me if I'm wrong but I believe that the mobile first approach with media queries was invented to prevent the downloading of big background-images on small viewports. That is a very valid reason. Now, if you don't use background-images the need to use this appoach is not as urgent anymore. But I do agree with @bradfrost that it will result in cleaner and smarter code. From a day to day web development practice I see that OLDIE's are rapidly becoming less important and small viewports are becoming more important. This is true even for big corporate clients. Using polyfills (or hacks) for IE might seem like a complex solution right now but it does result in better code for all modern browsers. I guess that's a best practice. What I'm not sure about is if media queries should be grouped on viewport level or on component level. I think I prefer the component level approach and I wouldn't know how to put that into the H5BP. So. That didn't answer the question at all, did it? (-: |
For the record, the asset downloading bug was fixed in WebKit 534.6.0 back in August 2010. That means Safari 5, iOS 4.3 and Android 3.0 do not yet have this fix. Safari 5.1 does. I can't tell if iOS 5 Mobile Safari does... (I would think the fix is in there.) |
If the main issue is the overhead created by respond.js for IE6-8, is there a reason why you can't remove it and use a single conditional comment for IE/IE Mobile, as-per Jeremy Keith's post here? http://adactio.com/journal/4494/ Forgive me if I'm covering previously discussed ground, or missing out on something else obvious. I know some don't like using CC's, but from a development and performance point of view I quite like this approach. |
Hey Brad, thanks for the details on browser support. Which of those browsers doesn't run JS, and so couldn't make use of the Respond polyfill?
From the design perspective, I agree. But I think there are some inherent tensions from a development perspective that means it goes beyond just a switch in mentality.
I get the feeling that that assumption has largely died. It is different to a 'wide-viewport-first' approach to development that still adapts to narrower viewports in browsers that support MQs or can run a JS polyfill. That won't provide an good experience in some environments. But that is not the same thing as ignoring the mobile landscape altogether or assuming pure-desktop browsing. For fairly complex sites (across all the front-end layers), the experience or preferred content on mobile devices will sometimes be better served with a dedicated and optimised website. Maintenance concerns might also play a part. In those cases, it may not be wise or practical to always try and deliver all experiences from a single front-end codebase. However, that doesn't necessarily mean that you cannot start with the base styles (for narrow viewports) first even in those cases. Which is why I'm happy to keep the MQs that build up to wider viewports as the default. If a developer wants to reverse them, it is very easy to do so. However, making the inclusion of Repond.js more visible might be beneficial and help those who aren't catering for mobiles (for whatever reason) avoid also penalising IE6-8 uses with unnecessary XHR of their stylesheets.
The concern was about what Respond needs to do in IE6-8. Plus, using CCs would mean that people using the boilerplate without the |
That is precisely the kind of "good practice" we need to encourage I think. I would even argue that we should leave it at that for any browser that is incapable of understanding media queries (including IE8) and let users decide on a good solution for IE (or provide it as a snippet in h5bp-ui). I think we need developers to think about this basic styling first rather than as an after thought. It would make sites at least readable (if not too usable) on most browsers. |
I see, ugh :-(
I like the sound of this. There are a few ways to approach handling IE, so let developers know the options and they can pick the most appropriate solution? |
Most of the browsers Brad mentioned are problematic. BlackBerry pre 6.0 ranges from poor to decent depending on the browser version (pre v.4.6.1 is almost completely useless), Netfront equally so (historically and on more recent devices like Kindle). The main thing is really that "JavaScript support" is not a binary thing. I wouldn't presume adequate support for any JS based polyfill on all those noted browsers until that polyfill has been thoroughly tested on each browser (I so far can't find specific evidence that they have). So from that point of view, you would also be wise to add most of S60/S^3 to that list, along with Nokia's S40 WebKit browser and their new S40 proxy browser. At this stage, I would recommend removing the media query polyfill and letting devs decide what is best for their particular scenario. We (yiibu) develop everything mobile first and handle all versions of IE using a series of conditionals. This has so far worked extremely well and is a great way to introduce clients to the reality of today's browser landscape. Browsers will continue to improve (and certain techniques will become redundant as support broadens) but Amazon's latest product releases are a great example of the browser/device diversity we can continue to expect. We need to get past the (reactive) polyfill-centric approach to this diversity and work towards more future friendly mindsets and techniques. |
Some food for thought... It seems to me that on larger teams/apps, Mobile-first may often become more of a maintenance cost than benefit. I am wondering if creating a more ubiquitous backend design with true duplicated views for mobile/web/tablet (as necessary) would make more sense. In larger cases, leveraging modular view fragments for each version of the site may be a simpler strategy than constantly "overwriting" aspects for varying MQs. Then there is less bloat in all cases (except maybe your routing/controller). If part of H5BP is good practices, we may want to help teach app architecture... not declaring the above strategy is right in all circumstances, but in many apps the feature (and design) gap between mobile and desktop is frankly just too vast. Obviously H5BP is also meant to be backend-agnostic, so I wouldn't push any harder than maybe documentation or a couple of empty view folders. |
There is the extra cost for IE6-8 that comes from doing mobile first and respond.js. Yes FOUC sucks, but the tradeoff for mobile users, which will eventually overtake ie6-ie8 users, is worth it. Mobile first is awkward for developers at first, but it's the right way to approach responsive website design. You end up serving less resources to mobile devices and you will write less CSS code than designing from the desktop down. In my experience, you can build on your mobile styles for tablets and desktops with small adjustments under the appropriate media queries. The first responsive sites I built were from the desktop down, and I ended up wasting a lot of time moving my CSS between media queries, or writing more CSS than was necessary instead of just being able to make small adjustments as I do now using a mobile first approach. |
Definitely. But I am not sure if most of the audience of H5BP writes such applications to begin with. I guess we would need a survey to find out.
I think there are multiple issues at hand, one of which is styling. This issue specifically addresses the issue of media queries in CSS and not about the content or the overall architecture of the site. Those are big issues and we definitely lack any definition of best practices and probably something we would want to tackle as part of h5bp-ui. |
There are other ways to deal with non MQ browsers instead of respond.js - http://coding.smashingmagazine.com/2011/08/10/techniques-for-gracefully-degrading-media-queries/ You could say that in some use cases even respond.js isn't a good enough polyfill. This seems like the kind of thing that should be left up to the developer, it depends on the target audience of each site. |
@necolas: All WP7 users should be able to update, not sure if there are problems as there were with the Nodo (copy&paste ;) update in Feb. I reckon at the end of this year latest all users COULD update (does not necessarily mean they do though). IE9 on Mango actually IS nice (for what I know for now). +1 for mobile first, I did some work using this approach (without H5BP) and after a little while it feels natural. BTW, is a separate "mobile" BP actually needed anymore? |
I disagree that these need to be two different issues; architecture and CSS definition are not mutually exclusive. CSS minification + concatenation is cheap (if not free) for building apps these days. Including just the relevant bits and selectively inlining CSS may make more sense than MQing. Recently, I've been really interested in revisiting inlining small minified CSS snippets instead of larger concatenated (cached) common files. An example (of all styles required on the product page) from a new version of AE.com targeted at our PoS machines (where speed is the top priority):
...Five small CSS files concatenated and minified into two CSS snippets. I know that is a very specific and simplified use case, but the lack of external requests significantly improves performance and omits any possibility of stylesheet timeout issues, etc. I'm sure many of you will be quick to rebut that inlining these fragments will be worse in case X or case Y, and that I am choosing one evil over another... but I think that is really the moral; H5BP probably shouldn't steer people toward habits that may come back to bite them on a different project. I think education and configuration is more important than producing a one-solve-fits-all. From HTML5 Boiler Plate README:
Let me tell you a quick story of which this conversation has reminded me... Please remember that we all develop for the user, and I think we can all agree that the user has the best experience on a site specifically designed for the device they are using. For most sites that would use H5BP, responsive design means omitting user choice of multiple "appropriate" site versions and instead giving them a single "flexible" version. We do this because it theoretically makes our lives easier and theoretically provides the best user experience. For any given project, the developer should still remember to ask the question "Does it?" |
The Mobile Boilerplate is primarily for mobile web apps. |
@jswartwood - You're touching on a very important issue. All of these techniques we're introducing need to make solid sense for real people. A lot of responsive designs bend over backwards to account for small screens, but in doing so add a whole lot of overhead. The end result are needlessly complex designs that might not offer any real value to the people using the sites. I sometimes wonder if the designers actually USE the sites on mobile devices, or are simply doing it to do it. For the most part, only developers and people coming from sites like http://mediaqueri.es are the only ones squishing and scaling these sites. A user on a portrait-only Blackberry Bold doesn't care that the layout is responsive. What really matters is how quickly they can accomplish their goals and get on with their day. With every polyfill, every cartwheel required to create a flexible system (especially if trying to shoe-horn an existing desktop site into a smaller frame), we're introducing more complexity, which affects performance and usability. @necolas touched on the fact that sometimes separate mobile templates make more sense, and Luke Wroblewski also highlighted why he chose to use of separate templates: http://www.lukew.com/ff/entry.asp?1390. Media elements (images, videos and more) and source order are two of the biggest challenges I've faced when creating responsive sites. It ultimately comes down to the project and how much the experience might change across the different form factors. Even if separate templates are used, they both should be as flexible as possible. As far as H5BP is concerned, I'm not exactly sure what I would change, but I would encourage starting from simpler, more universal stylings then working the way up to larger screens and more complex stylings. |
This presentation is really good: Crap! It doesn't look quite right, or, how I learned to stop worrying and set my mobile web sites free
Main problem of the "mobile-first" approach is that many designs aren't fluid or couldn't be fluid/responsive (relies heavily on images, complex interaction, lots of content, etc), also because of high expectations. It's a nice concept but I still can't see it being adopted on many kinds of projects because of technical difficulties and deadlines (as some people pointed before). I hope to follow this approach on many projects but I can't see it being adopted by most people right now.. I think this discussion was a good thing since it will make more people aware of the benefits/drawbacks of each technique and we should probably add info about this subject to the documentation so people can use it if they think it is the right approach. I think it should only become the default if the majority of users are following this approach (which I believe won't be true for a long time...) The future friendly website contains links to useful resources/articles and a manifesto. |
I'm gonna throw my hands up and admit I've never designed or built a site "mobile first". Even when it's fully responsive, I always start at desktop level and scrunch everything down if needed... but I think @bradfrost has it right with:
Hits the nail on the head, for me. It's not suitable for every project. Still would love to have it optional as part of the custom-build boilerplate download. |
on letting the developer decide..Part of what drives threads like these is that I'm of the mind that it's not effective when its always up to the developer to decide which approach to take. Best practices are powerful because you can put credence in them and developers save time and money not exploring their options each time. This is precisely why HTML5 Boilerplate is appreciated (i hope!); it trots out some defaults that have a lot of data behind them and we feel comfortable of these being a baseline of web developer projects. In some cases, sure, it comes up to a judgement call. But I think in nearly all cases things can be boiled down to a few questions that point to your best recommended approach. And I feel strongly that these approaches need to have data to back them up as the right approach. so..Thanks everyone for weighing in here. Just gonna round up some facts, first...
Techniques for NVP MQs:
Separate files with CC approaches<link rel="stylesheet" href="global.css">
<link rel="stylesheet" href="desktop.css" media="all and (min-width: 700px)">
<!--[if (lt IE 9)&(!IEMobile 7)]>
<link rel="stylesheet" href="desktop.css">
<![endif]--> or <link rel="stylesheet" href="global-including-desktopstyles-inMQs.css">
<!--[if (lt IE 9)&(!IEMobile 7)]>
<link rel="stylesheet" href="just-desktop.css">
<![endif]--> or “Mobile first” CSS and getting Sass to help with legacy IE by nicolas gallagher Why do NVP-first?
Also, zomigi's recent post on this media query business is an excellent read. |
oh man, i feel like we're dating now. AND I'M VERY EXCITED BY THE PROSPECT. Some moments on the internet make me so happy. Srsly. |
Here’s why mobile first is awesome: http://www.mediawiki.org/wiki/Athena |
Don't suppose... was there any consensus on this? I guess it's not something with a one-size-fits-all solution, and I should probably write some CSS instead of procrasturbating over the NVP vs. WVP issue, but would love to hear if there'd been any updates. Great thread though! |
Great discussion. Regarding the idea of including an ie.css, thereby removing the need for respond.js --- I understand and appreciate the goal of having only one stylesheet for all browsers. I've tried the mobile-first respond.js approach. But as we're weighing the options here, I'm liking the idea of dropping respond.js and simply providing legacy IE with desktop styles within a conditional comment. Let me make sure I have the picture right --
If I understand correctly, this approach has these pros and cons:
Am I on target with this? |
Wait. I just followed the link provided in the above discussion to Jeremy Keith's post http://adactio.com/journal/4494/ His solution, which addresses what I just laid out above, but more elegantly, is to have two files:
Then he uses a media query and a conditional comment to provide layout.css only as needed:
His code snippet with my comments:
The advantages here seem significant, as this approach:
In addition, this approach still allows me to adjust the conditional comment to support only the versions of IE I choose to support with layout. For instance, if I do not wish to provide layout for IE 6:
Moreover, if I want more precise media queries for mid-width devices (like tablets) and ultra-wide monitors, I can easily take and adjust this approach to cover such cases. The easiest way may be to include tablet-width layout within a media query inside global.css and then address mongo-width layout within a media query inside the layout.css file. |
Maybe you mean small screen first? Setting up media queries before designing is a bad idea IMO. Also, designs should work without media queries first, usually on a fluid page that works well on small screen. second media queries can be bundled in at design breakpoints, not device breakpoints. Mobile first doesn’t really matter at this point, but optimization should always be considered. |
Already gone over that in one of the first comments: #816 (comment)
That hasn't been suggested. H5BP only includes placeholder MQs that we say should be customised to the needs of the design.
This is already how H5BP works.
We already recommend this and it has been discussed in various issues, including by Paul above: #816 (comment) |
@davidcochran Following Jeremy Keith's post http://adactio.com/journal/4494/ and your explanation, you guys say that "global.css is to provide base styles for all devices, including mobile-first styles", while layout.css is "to provide layout for WVP" and is used by media query non-compliant browsers, so if I understand correctly no media queries written there. Questions: I personally find @necolas (http://nicolasgallagher.com/mobile-first-css-sass-and-ie/) suggested method more clean & easy to deal with -but it assumes one uses SASS, and I wouldn't know the performance hit of all those @import. core.css layout.css ie.css What do you guys think? Hopefully I haven't got anything awfully wrong! |
@necolas's SASS solution is a nice one, and there are folks working on analogous procedures for users of LESS. But H5BP can't yet depend on everyone using those technologies -- and probably can't until CSS is remade to work like SASS or LESS. (Which would be great!) Meanwhile, for non-SASS/LESS users ... the two-CSS-file solution is just really straightforward -- 1. global styles for all browsers (with everything needed by NVP browsers) and 2. desktop styles which address anything needed for IE6-8. Because legacy IE simply ignores what's behind media queries, I can use those same two files to address browsers that do understand media queries. I can tuck layout for tablets behind a media query in global.css, and layout for extra large screens behind a media query in layout.css. IE6-8 will never know these were there. Of course ensuring that nothing essential for IE6-8 is hidden behind a media query takes planning, but that's par for the course. This strikes me as relatively elegant in these ways:
Everybody's needs are met, and I've burdened IE6-8 as little as possible, leaving them free to live or die at their own pace. |
But then again -- reading you more closely now I think -- if one were to take your method and combine it with the new H5BP build script, which will inline all of the imported CSS files prior to production ... That'd be pretty darn elegant. Except you can reduce HTTP requests by importing core.css along with your media queried styles in each case. Which would give us something like: modern.css -- everything needed for modern browsers
legacy.css -- everything needed for IE6-8
Advantages
|
@davidcochran Ah, you highlighted the advantages better than me! :)
And yes, if production files can be built by inlining imports, I couldn't ask for more.. So that would be, hamly speaking: -# Layouts for MQ-capable browsers with: modern.sass @import "core" legacy.sass @import "core"; Am I on track? With the @imports you suggested and by inlining in production we are saving 1 further request compared to my original suggestion. |
Actually, I think I am going back to: / Core layout (no media queries) That's because IE8 will download responsive.css, thus if i place the same @import there as there is in static.css, there's duplication. |
Having just ready Juriy Zaytsev's examination of the performance hit caused by unused CSS selectors, such as selectors included for legacy IE (see note 13, and then the summary) ... I wonder if this doesn't reinforce the two-stylesheet approach, whereby styles for legacy browsers that don't understand media queries are provided in a separate stylesheet -- typically provided to IE 6-8 with a conditional comment. Whether you call the second stylesheet ie.css, legacy.css, desktop.css, or what have you ... If we can work up good ways to use a tool such as SASS or even the ANT build script to make a two-stylesheet approach more easily maintainable, we now have clear evidence of further benefits: besides saving the need for respond.js, it leaves us with trimmer stylesheets and promises snappier web apps. |
I'd like to propose this solution...which is to provide no default solution (because there is none):
|
Agreed with your solution @necolas +1 last item on the list too. |
@necolas I think that a wiki page would be a great way to articulate these many shades of gray. As for the last point, I think including device-specific dimensions is definitely dangerous, but it's still beneficial to include examples to assist syntax and spread awareness of a great technique. Perhaps changing the dimensions to something less device-specific and possibly em-based (perhaps min-width: 35em?) would move things in the right direction. |
@bradfrost We mention in the comments that they are placeholders which should be modified as the content requires (although I thought those comments were more obvious than they actually are). However, I'm not sure using |
@necolas Yeah if you're seeing enough people just leaving them in there without touching them then perhaps it is better to remove them altogether. If they do stay, I'd still recommend changing the 480px and 768px to dimensions that are a bit more ambiguous in order to break the device-specific mental model. |
@necolas I totally agree with @bradfrost about changing the px based MQs to em based. |
I think that default media queries in the css are a great tool. If people are just using the boilerplate css without modification (and then making their modifications in a separate block of css), then that's a good reason to comment out the media query blocks due to the potential added overhead of unused media query blocks, but removing them altogether and relying on an external document to convey them as defaults is a pretty major step down. P.S. I think that taking away solutions that work (as much as anything in this crazy browser ecology we live in) -before- the alternative exists is putting the cart before the horse, so let's start the wiki page first (assuming it doesn't yet exist) and get that solid before removing compatibility tools, right? |
I've tried to strike a balance between all the concerns that have arisen here. Thanks to everyone who helped and took the time to post opinions and ideas on this issue! I hope you'll all continue to help out in the future with suggestions and info. |
🍺 |
As of 2013-04-12, distributed version of HTML5BP Responsive is broken: media queries doesn't work on ie7 - ie8 while it does work for the online demo version!!! |
@Jaujon, there is no media query support in IE7 and IE8. Check out https://github.com/scottjehl/Respond. |
What about something like this? <!--[if (gte IE 9)|!(IE)|(!IEMobile)]><!-->
<link rel="stylesheet" href="responsive.css">
<!--<![endif]-->
<!--[if (lt IE 9)]>
<link rel="stylesheet" href="all.css">
<![endif]--> responsive.css and all.css are same, all.css just don't have media queries Or something like this: @import "_small";
@media only screen and (min-width: 768px) {
@import "_medium";
}
.lt-ie9{
@import "_medium";
} |
IE6-8 require respond.js to act as a polyfill because H5BP uses mobile-first media queries.
I'm not convinced mobile-first media queries are best.
What mobile browsers (in use, currently) do not support media queries? Moreover, of the ones who don't, are there browsers that don't scale the content to somehow adapt to the small screen size?
I don't know enough of the Blackberry/Nokia product line to know what's up on this front. But I have a feeling the mobile-first MQ setup is a lot of work. And the payoff is not worth the effort.
The text was updated successfully, but these errors were encountered: