Skip to content

Commit

Permalink
Update examples of 3 header variants
Browse files Browse the repository at this point in the history
Closes #89
  • Loading branch information
thatbudakguy committed Jan 15, 2025
1 parent ba68112 commit 0187698
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 114 deletions.
229 changes: 125 additions & 104 deletions header/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

<body>
<h1>Headers</h1>
<h2>With navigation links</h2>

<h2>Dark version (customizable color)</h2>

<nav
id="skip-link"
class="visually-hidden-focusable"
Expand Down Expand Up @@ -113,7 +115,6 @@ <h2>With navigation links</h2>
</div>
</div>
</nav>

<div id="feedback" class="collapse">
<div class="container pt-3">
<div class="row justify-content-center">
Expand Down Expand Up @@ -194,14 +195,14 @@ <h2>With navigation links</h2>
type="submit"
name="commit"
value="Send"
class="btn btn-secondary"
class="btn btn-primary"
data-disable-with="Send"
/>
<button
name="button"
type="button"
data-action="feedback#cancel"
class="btn btn-outline-secondary"
class="btn btn-outline-primary"
>
Cancel
</button>
Expand Down Expand Up @@ -247,20 +248,23 @@ <h2>With navigation links</h2>
>
</div>

<h2 class="mt-5">Without navigation links</h2>
<h2 class="mt-5">White version ("SDR theme")</h2>

<nav id="skip-link" aria-label="Skip links">
<!-- skip links here -->
</nav>
<header>
<div class="container">
<a class="su-brand-bar__logo" href="https://www.stanford.edu"
>Stanford University</a
>
<div class="identity-bar bg-dark">
<div class="container">
<a class="su-brand-bar__logo text-bg-dark" href="https://www.stanford.edu"
>Stanford University</a
>
</div>
</div>
<nav class="navbar navbar-expand-md bg-dark palo-alto-dark">
<nav class="navbar navbar-expand-md">
<div class="container">
<a
class="mb-0 navbar-brand navbar-logo"
class="mb-0 navbar-brand navbar-logo polychrome"
href="https://library.stanford.edu"
>Stanford Libraries</a
>
Expand Down Expand Up @@ -309,115 +313,132 @@ <h2 class="mt-5">Without navigation links</h2>
</div>
</div>
</nav>

<div id="feedback" class="collapse">
<div class="container pt-3">
<div class="row justify-content-center">
<form
class="col-md-8"
action="/feedback"
accept-charset="UTF-8"
method="post"
<!-- feedback form here -->
</div>
<div class="masthead">
<div class="container">
<div class="row align-items-center">
<div
class="col-md-8 d-flex"
>
<div class="alert alert-info" role="alert">
Reporting from:
https://sul-arclight-prod-a.stanford.edu/catalog?group=true&amp;q=
</div>
<div class="mb-3 row">
<label class="col-md-3 col-form-label" for="message"
>Message</label
>
<div class="col-md-9">
<textarea
class="form-control"
rows="5"
required="required"
data-form-type="other"
name="message"
id="message"
></textarea>
</div>
</div>
<div class="mb-3 row">
<label class="col-md-3 col-form-label" for="name"
>Your name</label
>
<div class="col-md-9">
<input
class="form-control"
required="required"
data-form-type="other"
autocomplete="name"
type="text"
name="name"
id="name"
/>
</div>
</div>
<div class="mb-3 row">
<label class="col-md-3 col-form-label" for="email"
>Your email</label
>
<div class="col-md-9">
<input
class="form-control"
required="required"
data-form-type="other"
autocomplete="email"
type="email"
name="email"
id="email"
/>
<p class="text-secondary mt-2 mb-0">
This site is protected by reCAPTCHA and the Google
<a href="https://policies.google.com/privacy"
>Privacy Policy</a
>
and
<a href="https://policies.google.com/terms"
>Terms of Service</a
>
apply.
</p>
</div>
</div>
<div class="mb-3 row">
<div class="col-md-9 offset-md-3">Recaptcha stuff</div>
</div>
<div class="mb-3 row">
<div class="col-md-9 offset-md-3">
<input
type="submit"
name="commit"
value="Send"
class="btn btn-secondary"
data-disable-with="Send"
/>
<button
name="button"
type="button"
data-action="feedback#cancel"
class="btn btn-outline-secondary"
<div class="h1 my-3"><a href="/">Website at Stanford</a></div>
</div>
<div class="col-md-4 d-none d-md-block">
<nav
class="navbar navbar-expand d-flex justify-content-end"
aria-label="browse"
>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/item1">Item 1</a>
</li>
<li class="nav-item ms-3">
<a class="nav-link" href="/item2">Item 2</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</header>

<h2 class="mt-5">Light version</h2>

<nav id="skip-link" aria-label="Skip links">
<!-- skip links here -->
</nav>
<header>
<div class="identity-bar bg-dark">
<div class="container">
<a class="su-brand-bar__logo text-bg-dark" href="https://www.stanford.edu"
>Stanford University</a
>
</div>
</div>
<nav class="navbar navbar-expand-md bg-light">
<div class="container">
<a
class="mb-0 navbar-brand navbar-logo"
href="https://library.stanford.edu"
>Stanford Libraries</a
>
<button
class="navbar-toggler navbar-toggler-right collapsed"
type="button"
data-toggle="collapse"
data-bs-toggle="collapse"
data-target="#user-util-collapse"
data-bs-target="#user-util-collapse"
aria-controls="user-util-collapse"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>

<div
class="collapse navbar-collapse justify-content-md-end"
id="user-util-collapse"
>
<ul class="navbar-nav">
<li class="nav-item">
<a id="bookmarks_nav" class="nav-link" href="/bookmarks">
Bookmarks
<span
class="badge badge-secondary bg-secondary"
data-role="bookmark-counter"
>0</span
>
Cancel
</button>
</div>
</div>
</form>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/search_history">History</a>
</li>
<li class="nav-item">
<a
href="#feedback"
class="nav-link"
data-bs-toggle="collapse"
data-bs-target="#feedback"
>Feedback</a
>
</li>
</ul>
</div>
</div>
</nav>
<div id="feedback" class="collapse">
<!-- feedback form here -->
</div>
<div class="masthead bg-dark palo-alto-dark">
<div class="masthead bg-light">
<div class="container">
<div class="row align-items-center">
<div
class="col-md-8 d-flex"
>
<div class="h1 my-3"><a href="/">Website at Stanford</a></div>
</div>
<div class="col-md-4 d-none d-md-block">
<nav
class="navbar navbar-expand d-flex justify-content-end"
aria-label="browse"
>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/item1">Item 1</a>
</li>
<li class="nav-item ms-3">
<a class="nav-link" href="/item2">Item 2</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
</header>

</body>
</html>
48 changes: 38 additions & 10 deletions styles/header.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
:root {
--sul-logo-color: white;
--sul-logo-color: var(--stanford-black);
--identity-bar-color: var(--stanford-cardinal);
}

.bg-dark {
--sul-logo-color: var(--bs-navbar-color);
}

.identity-bar {
--bs-dark-rgb: var(--stanford-cardinal-rgb);
}

/* stylelint-disable selector-class-pattern */
.su-brand-bar__logo {
--bs-link-hover-decoration: none;
Expand Down Expand Up @@ -31,18 +40,37 @@
text-indent: 100%;
white-space: nowrap;
width: 280px;

&.polychrome {
background-color: transparent;
mask-image: none;
background-image: url("StanfordLibraries-logo-poly.svg");
background-repeat: no-repeat;
background-position: 0 center;
}
}

.bg-dark.navbar,
.bg-dark .navbar {
--bs-navbar-color: white;
--bs-navbar-hover-color: rgb(255 255 255 / 100%);
--bs-nav-link-color: white;
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='1' d='M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z' /%3e%3c/svg%3e");
--bs-navbar-toggler-border-color: rgb(255 255 255 / 10%);
.navbar,
.masthead {
--bs-navbar-color: var(--stanford-black);
--bs-nav-link-color: var(--stanford-black);
--bs-link-color-rgb: var(--stanford-black-rgb);
--bs-link-hover-color-rgb: var(--stanford-black-rgb);

.bg-dark &,
&.bg-dark {
--bs-navbar-color: white;
--bs-nav-link-color: white;
--bs-link-color-rgb: 255, 255, 255;
--bs-link-hover-color-rgb: 255, 255, 255;
--bs-navbar-hover-color: rgb(255 255 255 / 100%);

.collapsed {
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 17'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='1' d='M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8z' /%3e%3c/svg%3e");
--bs-navbar-toggler-border-color: rgb(255 255 255 / 10%);

.collapsed {
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
}
}

Expand Down
1 change: 1 addition & 0 deletions styles/palette.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
--stanford-cardinal-rgb: 143, 20, 20;
--stanford-cardinal: rgb(var(--stanford-cardinal-rgb));
--stanford-black: #2e2d29;
--stanford-black-rgb: 46, 45, 41;
--stanford-80-black: #585754;
--stanford-70-black: #6d6c69;
--stanford-30-black: #c0c0bf;
Expand Down

0 comments on commit 0187698

Please sign in to comment.