Skip to content

Commit

Permalink
[No ticket] Preprint branding rework (#1913)
Browse files Browse the repository at this point in the history
-   Ticket: []
-   Feature flag: n/a

- Only rely on `brand` relationship for setting preprint colors

- Use `brand.primaryColor` for branded navbar background color
  - Add styling if the brand's primaryColor does not provide sufficient contrast with white text
 - Add special-case for BioHackrXiv to change navbar color to white (their primary color would be white, but that creates problems for `<Button>` behavior, so their primary is black instead)
- Use `brand.heroBackgroundImage` for hero banner background, as well as advisory board section when @brianpilati implements that page. Currently just a solid color
- Use `brand.navbarLogoImage` for navbar logo if `preprintProvider.assets.square_color_transparent` is not defined
- Update `<Button>` component to detect primary color and use white/black text depending on color contrast
  • Loading branch information
futa-ikeda authored and bp-cos committed Oct 27, 2023
1 parent af7d42e commit 55be328
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/preprints/template.hbs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{{page-title this.theme.provider.providerTitle replace=true}}
<ThemeStyles />
<BrandedNavbar
@translateKey='collections.general.brand'
@brandRoute='preprints.discover'
@addLinkKey='collections.navbar.add'
/>
{{outlet}}
<div {{with-branding (get-model this.theme.provider.brand)}}>
<ThemeStyles />
<BrandedNavbar
@translateKey='collections.general.brand'
@brandRoute='preprints.discover'
@addLinkKey='collections.navbar.add'
/>
{{outlet}}
</div>

0 comments on commit 55be328

Please sign in to comment.