-
Notifications
You must be signed in to change notification settings - Fork 423
Theming
Forem has support for theming built right in. To apply a theme to the forem engine you must first install a Forem theme gem such as http://github.com/radar/forem-theme-base. These gems must be set up like a Rails engine, like this:
require 'forem'
module Forem
module Theme
module Base
class Engine < Rails::Engine
Forem.theme = :base
end
end
end
end
The forem
gem must first be required so that the Forem
module is loaded and has a theme=
method defined on it. By defining an engine like this, the hooks to the assets in this engine are created and so stylesheets, JavaScript files and images will be able to be included by either the forem engine itself or its host application.
To then apply the styling of this theme to your application you must place this line in your app/views/layouts/application.html.erb
file:
<%= forem_theme_tag %>
This line will include the app/assets/stylesheets/forem/base/style.css
file from the gem, which should either be a manifest file containing requires for other stylesheets so that Sprockets can read them, or a stylesheet itself.
Image and JavaScript support is currently not implemented.