Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navbar UI updates #1674

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Navbar UI updates #1674

merged 2 commits into from
Mar 2, 2023

Conversation

thatbudakguy
Copy link
Member

@thatbudakguy thatbudakguy commented Feb 17, 2023

  • Refactor templates to keep Spotlight's header navbar
  • Hide the sign in link in the navbar

Ref #1372. First commit makes it so that the navbar still appears on auth pages.

@thatbudakguy thatbudakguy marked this pull request as draft February 17, 2023 18:54
@thatbudakguy thatbudakguy marked this pull request as ready for review February 17, 2023 20:44
@thatbudakguy thatbudakguy linked an issue Feb 17, 2023 that may be closed by this pull request
white-space: normal;
visibility: hidden;

+ small {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this? What content is in the small that we want hidden? Can we just put the hidden style on that element in the template so it's easier to understand the connection?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spotlight by default inserts the exhibit title and some other content, but we don't want to show it because DLME has only one exhibit and the title is rendered elsewhere. I think this rendering happens in spotlight, so we'd need to override an entire template to do that. Part of the point of this PR was reducing the amount of things we override.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to note the above

app/assets/stylesheets/dlme.scss Outdated Show resolved Hide resolved
@@ -253,28 +262,34 @@ body {
}

.topbar {
position: absolute;
width: 100vw;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is these necessary? Topbar is already full width.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing styles don't have an effect once its position is changed to absolute, which is necessary to overlay it on the masthead.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we changing to absolute? I'm really struggling to understand that purpose of these changes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We overrode several spotlight templates in order to construct an HTML setup where the navbar was inside the masthead, in order to implement the current design. This PR gets rid of all the overrides in favor of creating that appearance via a small amount of CSS instead, so we don't diverge from Spotlight so much. It also means that we get to keep the default navbar, so it automatically appears on pages that do not have a masthead, like login pages, which is part of the ticket.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifically, we use absolute so that the navbar can be positioned over the top of the masthead, which is its following sibling.

@thatbudakguy thatbudakguy force-pushed the signin-ui branch 2 times, most recently from 708e077 to 433b47e Compare February 21, 2023 19:49
This ensures that the header and navbar are still displayed on
pages where the masthead is not (like auth flow pages), and
removes some places where we overrode Spotlight.

See #1372
}

// Turn off transparency for the topbar on pages where there's no masthead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add "(e.g. the pages provided by Devise)"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

}
}

.masthead .topbar .navbar-nav {
.topbar .navbar-nav {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extra space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

.masthead .site-title {
text-align: center;
.masthead .site-title-container {
display: none;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comma here with the reason we're not displaying it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

@@ -275,6 +281,11 @@ body {
text-decoration: underline;
}
}

// hide the "sign in" link
&[href="/users/sign_in"] {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, good call. made that change

@jcoyne jcoyne merged commit 07939cd into main Mar 2, 2023
@jcoyne jcoyne deleted the signin-ui branch March 2, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide the "Sign in" link in the site brandbar
2 participants