This is a backport of !778 (merged) without the Gitlab::Themes refactor for the 7.12 branch.
Gitlab::Themes