Open link in a new tab

Content

Expand project menu

Change default favicon/shortcut icon from theme

Hi,

So far I’ve created a custom theme using the openproject-plugin plugin ans successfully deployed and enabled it on our installation.

Now I would like to *replace the default theme favicon*/shortcut icon with a custom version from my custom theme.

Is that possible? If yes, how could I approach this?

Thanks a lot!
Ole.

Message actions

Hi Ole,

I don’t know the structure of your theme so it is hard to say. I added a theme skeleton in this thread
In a Theme like this you can just add your new favicon.icon to the following folder:

app/assets/images/shiny/

Best
Ratzi

Message actions

Hi Ratzi,

my theme is structured paractically identical, but not quite :) I’ll take a look and see if I can figure out why this works for you and not for me :)

Just to elaborate: I can add assets to my theme and can access them, but existing assets like favicon.ico are not being overridden/replaced.

Cheers,
Ole.

Message actions

Hi again,

you have to set the theme ‘assets_path’. See lib/open_project/themes/shiny/all.rb:9 and lib/open_project/themes/shiny.rb:6

Best
Ratzi

Message actions

Wow, thank you, that actually did the trick!

Thanks again,
Ole.

Message actions

You’re welcome.

If you have a look in ‘app/assets/stylesheets/shiny/_variables.css.sass’ you can may be improve your theme by just overriding the OpenProject core SASS variables so you don’t have to override the css Rules by hand.

Best
Ratzi

Message actions

Thanks for the advice! I suppose this way it should be possible to adjust global values (like the highlight color) much quicker than by adjusting every single rule by hand. I’ll definitely give it a try! I’ve found a seemingly comprehensive list of variables in https://github.com/opf/openproject/blob/dev/app/assets/stylesheets/global/_variables.sass.

Thanks a lot for your support!
Best, Ole.