Skip to content

Custom CSS in the Admin area for cms fortress greater than 1.3.6 and Comfy greater than 1.12.5

Andreas Wenk edited this page Feb 19, 2015 · 1 revision

Up from Comfy 1.12.5, the structure of the assest has changed significantly. If you want to integrate custom CSS, you have to follow these steps:

  • create a folder in app/views to overwrite the header partial:

    app/views/comfy/admin/cms/partials/

The reason is, that Comfy is including partials from this directory.

  • place the partial _html_head.rb in there

    app/views/comfy/admin/cms/partials/_html_head.rb

  • include your CSS or JavaScript files in there. E.g.:

    = stylesheet_link_tag 'comfy_override/admin/cms/custom', media: 'all', 'data-turbolinks-track' => true

  • create the CSS file with your overrides. From the example above it is:

    app/assets/stylesheets/comfy_override/admin/cms/custom.css.scss

And that should do the trick. The include tags will be included after all the other CSS and JavaScript inclusions in the <head></head> section.

As this is a bit fishy but still ok, you can expect a better way in future releases.