Problem
I made a custom Font-Awesome field that displays a stored icon name string ("fa-facebook") as its rendered icon rather than its name. After getting the appropriate gem, I need to add one line into the application.css file.
Generating the entire administrate:assets:stylesheets stack so I can plug this one value in seems a bit sledgehammerish.
Ideas
Not sure if any/all of these are technically possible.
require into the main app by looking in a special folder or file.require administrate.scss etc... entry in it. This would allow additional requires before or after the gem scss.administrate.scssOr maybe I am just dense and am not seeing the easy way to do this without freezing the entire stylesheet stack into my main app. Ideas?
having this same issue right now. trying to just get something to work. curious how you accomplished injecting css
One option may be to do the same thing that you guys do for javascript - have a partial that can be overridden that has a =yield :stylesheet
That way, you could use a small stylesheet and put the tag in a content_for(:stylesheet) block - if you only need to customize styles for certain pages. If you need a custom style to apply to everything, then you could just create your own _stylesheets.html.erb
An alternative approach is to generate the layout with rails g administrate:views:layout and either add your custom stylesheet to the <head>, or @import "administrate/application"; in your custom stylesheet and completely replace the stylesheet_link line already in the layout.
@coneybeare Wondering if this commit solves your problem here.
You can now call Administrate::Engine.add_stylesheet to pass a custom stylesheet to be included on every admin page. Does this solve the issue?
cc @sebbean @marksiemers @bessey
I'm not using administrate anymore, but this does look like it would have resolved the issue.
@coneybeare Awesome, thanks for the update! If you give Administrate another try in the future, we'd welcome your feedback. Thanks again :)
Most helpful comment
@coneybeare Wondering if this commit solves your problem here.
You can now call
Administrate::Engine.add_stylesheetto pass a custom stylesheet to be included on every admin page. Does this solve the issue?cc @sebbean @marksiemers @bessey