I have the following setup with my style sheets in a Rails 3.2 application. I have an application.css file with many styles defined in them and several other files for more specific styles, for example, everything related to the footer is in footer.css.
Everything works in development, but during the production process, none of the mobile styles in the required files is compiled, i.e. everything above the line @media only screen and (min-width: 768px) for each style sheet.
The main application.css file contains about 700 lines of styles, after which it also has @media only screen and (min-width: 768px) media request. Inside the media query, there are about 700 lines overlapping the previous 700 lines of desktop styles. However, these styles have been compiled successfully. I do not understand why the required files do not work properly.
application.css
*= require_self *= require base.css *= require footer.css .benefit { display: block; font-size: 0.8em; margin: 1em; } @media only screen and (min-width: 768px) { .benefit { font-size: 1em; margin: 3em; } }
Base.css
header, section, footer, aside, nav, article, figure { display: block; } html, body { height: 100%; background:
footer.css
footer { background:
Edit: I tried to explicitly add the necessary styles of mobile CSS files to my own media queries, as suggested in this answer , and updating the code below, but that didn't work.
footer.css
@media only screen { footer { background:
source share