I have two different css files in my theme, one for Desktop and other for Mobile version. I want to render Desktop css file only for desktop mode and Mobile css file only for mobile mode. Do I need to make any modification in .info of my Theme?


Yes, you can do this with media queries in your info file.


stylesheets[all][] = css/style.css


stylesheets[all and (min-width: 960px)][] = css/style.css 

That being said, you can repeat a lot of work doing it that way. It might be easier to declare all of your styles that you know will change in a responsive.css style sheet, and use

@media all and (min-width: 768px) { /* all of your styles here */ } 

At the bottom to change the values for a mobile version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.