The whole point of sprockets is that you include what you need. You can always add another stylesheet to the page as a whole. It's good practice to compile into one with users, but if backend is used by administrators, adding another stylesheet is totally fine.
First off, application.css
is already precompiled, so you just need:
config.assets.precompile << 'backend.css'
Optionally include an additional stylesheet, so application.css
has foundation, etc and backend.css
has just additional styling:
<%= stylesheet_link_tag 'application', media: :all %>
<% if admin? %>
<%= stylesheet_link_tag 'backend', media: :all %>
<% end %>
You can also add a shared
directory for stylesheets that are for both if for some reason the application.css
styles would conflict with the backend.css
styles.
+ stylesheets
+ shared
+ app
+ backend
- application.css
- backend.css
And require_tree ./shared
in both.