Skip to content

Commit 54b822e

Browse files
committed
Allow for optional platform names in header
Why these changes are being introduced: Matt added the platform name to Omeka to remind users where in the MITL ecosystem they are. We were planning to add this to Geodata when we realized that it would probably be useful in other Rails apps, and should thus go in the theme gem. Relevant ticket(s): https://mitlibraries.atlassian.net/browse/GDT-124 How this addresses that need: This adds an optional platform name in the header, based on the `PLATFORM_NAME` environment variable. Environments that don't set `PLATFORM_NAME` will continue to have the standard header. Side effects of this change: The SCSS updates for this should likely be moved upstream to the style guide, but I couldn't decide if that should happen before or after this merges.
1 parent 93b931b commit 54b822e

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

app/views/layouts/_site_header.html.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<span class="sr">MIT Libraries home</span>
88
<img src="https://cdn.libraries.mit.edu/files/branding/local/mitlib-wordmark.svg" height="35" alt="MIT Libraries logo">
99
</a>
10+
<% if ENV['PLATFORM_NAME'] %>
11+
<a href="/" class="platform-name"><%= ENV.fetch('PLATFORM_NAME') %></a>
12+
<% end %>
1013
</h1>
1114
</div>
1215
<div class="wrap-header-supp">

vendor/assets/stylesheets/elements/_header.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@
4040
}
4141
}
4242

43+
.platform-name {
44+
color: #fff;
45+
font-size: 2.8rem;
46+
text-decoration: none;
47+
vertical-align: middle;
48+
border-left: 1px solid #fff;
49+
padding-left: 2rem;
50+
margin-left: 2rem;
51+
52+
&:hover,
53+
&:focus {
54+
text-decoration: underline;
55+
}
56+
}
57+
4358
.link-logo-mit {
4459
color: $white;
4560

@@ -53,6 +68,21 @@
5368
}
5469
}
5570

71+
@media (max-width: $bp-screen-md) {
72+
.wrap-header {
73+
.platform-name {
74+
border-left: none;
75+
padding: 0;
76+
margin: 2rem 0 0 0;
77+
display: block;
78+
}
79+
}
80+
81+
.wrap-header-supp {
82+
vertical-align: top;
83+
}
84+
}
85+
5686
// local header and nav
5787
.wrap-outer-header-local {
5888
border-bottom: 1px solid $gray-l2;

0 commit comments

Comments
 (0)