<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    >

<channel>
    <title>Webmonkey &#187; @media</title>
    <atom:link href="http://www.webmonkey.com/tag/media/feed/" rel="self" type="application/rss+xml" />
    <link>http://www.webmonkey.com</link>
    <description>The Web Developer&#039;s Resource</description>
    <lastBuildDate>Mon, 06 May 2013 17:29:19 +0000</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <generator>http://wordpress.org/?v=3.4.2</generator>
    
    <item>
        <title>W3C Looks to Improve Responsive Design With New Media Queries</title>
        <link>http://www.webmonkey.com/2012/07/w3c-looking-to-improve-responsive-design-with-new-media-queries/</link>
        <comments>http://www.webmonkey.com/2012/07/w3c-looking-to-improve-responsive-design-with-new-media-queries/#comments</comments>
        <pubDate>Thu, 19 Jul 2012 18:40:44 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=57985</guid>
        		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[@media]]></category>
		<category><![CDATA[Media Queries]]></category>
		<category><![CDATA[responsive design]]></category>
            <enclosure url="http://www.webmonkey.com/wp-content/uploads/2012/07/tablets-w.jpg" type="image/jpeg" length="48000" />
                    <description><![CDATA[<div class="rss_thumbnail"><img src="http://www.webmonkey.com/wp-content/uploads/2012/07/tablets-w.jpg" alt="W3C Looks to Improve Responsive Design With New Media Queries" /></div>The W3C, the group that helps create web standards, is hard at work on CSS Media Queries level 4, which gives developers several handy new tools for building responsive websites.]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><div id="attachment_53661" class="wp-caption alignleft" style="width: 590px"><a href="http://www.webmonkey.com/wp-content/uploads/2012/01/tablets.jpg"><img src="http://www.webmonkey.com/wp-content/uploads/2012/01/tablets.jpg" alt="" title="tablets" width="580" height="434" class="size-full wp-image-53661" /></a><p class="wp-caption-text">A handful of the many screens your site needs to handle. <em>Photo: Ariel Zambelich/Wired.com</em></p></div>The W3C, the group charged with overseeing the creation of web standards like HTML and CSS, recently <a href="http://www.webmonkey.com/2012/06/its-official-css-media-queries-are-a-web-standard/">gave its official blessing</a> to one of the cornerstones of responsive web design &#8212; CSS Media Queries.</p>
<p>CSS Media Queries are the basic building block of <a href="http://www.webmonkey.com/2011/06/tips-tricks-and-best-practices-for-responsive-design/">responsive design</a>, which, at its simplest, just means building websites that work on any device. That way, when a dozen new tablets suddenly appear on the scene you can relax knowing your site will look and perform as intended, no matter which device your audience is using.</p>
<p>Now that the Media Queries Level 3 spec has been finalized, work has started on CSS 4 Media Queries, or more formally, <a href="http://dev.w3.org/csswg/mediaqueries4/">Media Queries Level 4</a>.</p>
<p>The W3C&#8217;s draft spec of Media Queries Level 4 adds <a href="http://dev.w3.org/csswg/mediaqueries4/#changes-2012">three new features</a> you can query in your stylesheets, including:</p>
<blockquote>
<ul>
<li><b><code>script</code></b> &#8212; Query to check if JavaScript is enabled.</li>
<li><b><code>pointer</code></b> &#8212; Query to see what sort of input device is being used (mouse, finger, stylus etc).</li>
<li><b><code>hover</code></b> &#8212; Query to see if the :hover pseudo-class will work on the current device.</li>
</ul>
</blockquote>
<p>Perhaps the most interesting is the middle option, <code>pointer</code>, for which the user agent (your browser) is expected to return the value &#8220;none,&#8221; &#8220;coarse&#8221; or &#8220;fine.&#8221; According to the current draft of the spec, &#8220;typical examples of a &#8216;fine&#8217; pointing system are a mouse, a track-pad or a stylus-based touch screen. Finger-based touch screens would qualify as &#8216;coarse.&#8217;&#8221; </p>
<p>Using the <code>pointer</code> query would make it possible to enlarge, for example, form controls on screens where a larger radio buttons might make things easier to select, or perhaps to change how paint flow is handled in a drawing app.</p>
<p>Of course, while potentially handy, none of these queries are yet supported in any web browser, so don&#8217;t go using them just yet. That said, the more progressive browsers like Opera, Chrome and Firefox will likely add preliminary support as the spec progresses. It&#8217;s also likely that some enterprising web developer will <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">create a polyfill</a> for older browsers before too long.</p>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2012/07/w3c-looking-to-improve-responsive-design-with-new-media-queries/feed/</wfw:commentRss>
        <slash:comments>1</slash:comments>

        
    </item>
    
    <item>
        <title>Adapt.js Offers JavaScript Alternative to CSS Media Queries</title>
        <link>http://www.webmonkey.com/2011/04/adapt-js-offers-javascript-alternative-to-css-media-queries/</link>
        <comments>http://www.webmonkey.com/2011/04/adapt-js-offers-javascript-alternative-to-css-media-queries/#comments</comments>
        <pubDate>Tue, 19 Apr 2011 15:36:19 +0000</pubDate>

                <dc:creator>Scott Gilbertson</dc:creator>

        <guid isPermaLink="false">http://www.webmonkey.com/?p=50640</guid>
        		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[@media]]></category>
        <description><![CDATA[With the mobile web comes a new set of design problems: how do you fit your content on a much smaller screen, and, more generally, how do you make your site look good no matter what size screen it&#8217;s on? The growing consensus is that Responsive Web Design &#8212; websites that adapt to the size [...]]]></description>

            <content:encoded><![CDATA[<p><!-- wpautop enabled -->
<p><img src="http://www.webmonkey.com/wp-content/uploads/2011/04/mediaq.jpg" />With the mobile web comes a new set of design problems: how do you fit your content on a much smaller screen, and, more generally, how do you make your site look good no matter what size screen it&#8217;s on? The growing consensus is that Responsive Web Design &#8212; websites that adapt to the size of the user&#8217;s screen &#8212; is the way forward. </p>
<p>For many developers that means <a href="http://www.webmonkey.com/2010/09/make-a-big-splash-on-small-screens-with-media-queries/">using @media queries to selectively target the device screen size</a> and orientation through CSS.</p>
<p>While the @media approach is a good one, it won&#8217;t work for every site. That&#8217;s why Nathan Smith, creator of the <a href="http://960.gs/">960 Grid System</a>, has released <a href="http://adapt.960.gs/">Adapt.js</a>, a lightweight JavaScript library (894 bytes minified) that allows you to specify a list of stylesheets and the screen sizes for which they should be loaded. Essentially Adapt.js does the work of @media, but will work in any browser, even those that don&#8217;t understand @media.</p>
<p>All you need to do is include Adapt.js in your pages and then define the sizes and stylesheets to go with them. Here&#8217;s the code from Smith&#8217;s example:</p>
<pre class="brush: js">
var ADAPT_CONFIG = {
  // Where is your CSS?
  path: 'assets/css/',

  // First range entry is the minimum.
  // Last range entry is the maximum.
  // Should have at least one "to" range.
  range: [
    '760px            = mobile.css',
    '760px  to 980px  = 720.css',
    '980px  to 1280px = 960.css',
    '1280px to 1600px = 1200.css',
    '1600px to 1920px = 1560.css',
    '1920px           = fluid.css'
  ]
};
</pre>
<p>While using JavaScript to load CSS might seem a bit strange, even if you use @media queries you&#8217;re still going to need some kind of polyfill (usually JavaScript-based) to <a href="http://www.webmonkey.com/2011/04/how-to-have-your-media-queries-and-eat-ie-too/">handle those browsers that don&#8217;t know what to do with @media rules</a>.</p>
<p>Of course Adapt.js isn&#8217;t right for every situation. Smith has a very nice take on the debate over @media, JavaScript, separate mobile websites and other options for dealing with the small screen:</p>
<blockquote>
<p>As with any field in which technological methods are open for debate, there is the danger of religious fanaticism, where we each rally behind a respective technique and defend it vehemently. I would advise you to consider your audience, weigh the options, and find an approach that makes sense for that particular context.</p>
</blockquote>
<p><strong>See Also:</strong><br/></p>
<ul>
<li><a href="http://www.webmonkey.com/2011/04/start-small-build-big-with-320-and-up/">Start Small, Build Big With &#8217;320 and Up&#8217;</a></li>
<li><a href="http://www.webmonkey.com/2011/04/how-to-have-your-media-queries-and-eat-ie-too/">How to Have Your @Media Queries and Eat IE Too</a></li>
<li><a href="http://www.webmonkey.com/2010/09/make-a-big-splash-on-small-screens-with-media-queries/">Make a Big Splash on Tiny Screens With Media Queries</a></li>
</ul>
<div id='linker_widget' class='contextly-widget'></div>]]></content:encoded>
            <wfw:commentRss>http://www.webmonkey.com/2011/04/adapt-js-offers-javascript-alternative-to-css-media-queries/feed/</wfw:commentRss>
        <slash:comments>4</slash:comments>

        
    </item>
    </channel>
</rss>
