Closed (fixed)
Project:
Versatile
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2012 at 14:18 UTC
Updated:
11 Mar 2012 at 18:20 UTC
What is the best way to make a sub-theme responsive? Currently the panels change from '/css/mytheme.css' to '/css/versatile_w640.css' and '/css/versatile_w480.css' when I shrink the browser.
In the versatile template.php there is Preprocess function for site template layout and it includes
$responsive = theme_get_setting('versatile_responsive');
if ($responsive) {
$module_path = drupal_get_path('theme', 'versatile');
drupal_add_css($module_path . '/css/versatile_w640.css', array('media' => 'screen and (max-width:640px) and (min-width:481px)'));
drupal_add_css($module_path . '/css/versatile_w480.css', array('media' => 'screen and (max-width:480px)'));
}
I am still using the versatile_site_template for mytheme.
Ideally it would be nice to use '/css/mytheme_w640.css' and '/css/mytheme_w480.css' but configuring this so far has not been successful for me...
Any ideas would be appreciated, thanks.
Comments
Comment #1
peter törnstrand commentedYou should probably disable the responsive features of Versatile and just add your own... when I look back on this feature I don't think it's a good idea to have this as part of the theme. Responsiveness is much to depending on the design of the page to make assumptions as those made in Versatile.
Comment #2
dig1 commentedYes I agree. I reckon its always best to keep it simple. So in template.php I added
and that seems to do the job.
Thanks