OSC / ood_appkit

https://osc.github.io/Open-OnDemand/
MIT License
1 stars 2 forks source link

Bootstrap overrides in configuration or in env var don't allow changing the navbar height #24

Closed ericfranz closed 7 years ago

ericfranz commented 7 years ago

The navbar height at awesim.org is 80px, not the default 50px for Bootstrap 3.

I tried setting the height to 80px with the env var: BOOTSTRAP_NAVBAR_HEIGHT='80px'

But this failed to change the height. However, when I override it in the application.css.scss, right after importing ood_appkit/bootstrap-overrides I add this line and it changes the height successfully: $navbar-height: 80px;

ericfranz commented 7 years ago

Ah, this makes sense:

https://github.com/OSC/ood_appkit/blob/84b3decd948b347928ee0563141a8eccf543fb61/lib/ood_appkit/configuration.rb#L112-L121

The code only allows overriding with ENV vars the configs that we have already explicitly specified.

Ugh. I'm liking the idea of a /public/custom.css more and more for branding.

ericfranz commented 7 years ago

Our documentation claims "You can easily override any bootstrap variable using environment variables" and gives examples like:

# Change font sizes
BOOTSTRAP_FONT_SIZE_H1='50px'
BOOTSTRAP_FONT_SIZE_H2='24px'

# Re-use variables
BOOTSTRAP_GRAY_BASE='#000'
BOOTSTRAP_GRAY_DARKER='lighten($gray-base, 13.5%)'
BOOTSTRAP_GRAY_DARK='lighten($gray-base, 20%)'
nickjer commented 7 years ago

Try clobbering your assets, then restarting the app.

nickjer commented 7 years ago

Seems assets in development mode are only re-compiled if that asset file has changed. Since we are using ERB, the file itself does not change. So assets will need to be clobbered even in development mode when environment variables are changed.