Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I'm afraid that this is impossible, but if you're feeling daring you could probably modify the source of adapt.js to do this. Here's the critical part of <a href="https://github.com/nathansmith/adapt/blob/master/assets/js/adapt.js" rel="nofollow">adapt.js</a>:</p> <pre><code>// If it's a range, split left/right sides of "to", // and then convert each one into numerical values. // If it's not a range, turn maximum into a number. val_1 = is_range ? parseInt(arr_0.split('to')[0], 10) : parseInt(arr_0, 10); val_2 = is_range ? parseInt(arr_0.split('to')[1], 10) : undefined; // Check for maxiumum or range. if ((!val_2 &amp;&amp; i === last &amp;&amp; width &gt; val_1) || (width &gt; val_1 &amp;&amp; width &lt;= val_2)) { // Build full URL to CSS file. file &amp;&amp; (url = path + file); // Exit the while loop. No need to continue // if we've already found a matching range. break; } </code></pre> <p>which is inside a while loop that checks the range conditions you specify in ADAPT_CONFIG. As you can see, once a path has been found, "range" ceases to be checked for any additional matches. You could probably change the code to allow it though - you'd probably have to move the code following the while loop into the above if statement and remove the break (this is an educated guess, I have not attempted this).</p> <p>However, depending on how you're serving the files, I would strongly consider looking into an asset manager to combine "style.css" and "mobile.css" into a single file - precompiling assets allows for a few other fun tricks, like automatically making the css files as small as possible.</p> <p>EDIT - if you're interested in an asset manager, there's really no one way to do it; it will depend heavily on the environment you're using at work. For something like rails this is super easy since merging files is fairly cooked in, and the sprockets gem has plenty of other features for asset management (combining files in it is pretty fast). If I were you though I'd probably just do some quick googling along the lines of "combining css files with ", there will be plenty of options. PHP scripts for this are all over the place if you don't have a fancy framework (<a href="http://code.google.com/p/minify/" rel="nofollow">here's</a> a promising example), and Google makes an <a href="https://developers.google.com/speed/pagespeed/mod?hl=fr-FR" rel="nofollow">Apache mod</a> for this kind of wok. </p> <p>If you do go this route, I'd encourage you to play around a bit once you get the basics working - you could do something nifty like generate the values for range in ADAPT_CONFIG in the same place as where you combine the files, giving you a nice clean, single point from where you can manage style files. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload