Skip to content

Commit 804f20a

Browse files
committed
Make nav bar white with bottom border
White background allows more colors to be used in the nav bar. Feels like there are too many horizontal lines in the app, but just playing around for now. We can try fixing this later.
1 parent 2477848 commit 804f20a

File tree

4 files changed

+27
-38
lines changed

4 files changed

+27
-38
lines changed

website/src/views/layout/GlobalSearch.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ $dropdown-height: 40rem;
1212
height: 100%;
1313
padding-right: $container-padding;
1414
margin-left: auto;
15-
border-right: 1px solid var(--gray-lighter);
1615
font-size: 0.9rem;
1716

1817
&:hover .icon {

website/src/views/layout/Navbar.scss

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ $logo-vert-padding: 0.875rem;
1010
top: 0;
1111
z-index: $navbar-z-index;
1212
padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
13-
background: var(--gray-lightest);
13+
background: var(--body-bg);
14+
border-bottom: 1px solid var(--gray-lighter);
1415
display: flex;
1516
flex-flow: column;
1617
align-items: center;
@@ -76,6 +77,21 @@ $logo-vert-padding: 0.875rem;
7677
@include media-breakpoint-down(sm) {
7778
.navbarWrapper {
7879
top: -$navbar-height;
80+
border-bottom-width: 0;
81+
82+
// Fake shadow - can't use box shadow because they will appear on top of the
83+
// top nav bar
84+
// TODO: See if box shadow works now because this shadow is now on the nav bar itself
85+
&::after {
86+
content: '';
87+
position: absolute;
88+
right: 0;
89+
bottom: -$navtab-shadow-height; // TODO: Rename these vars
90+
left: 0;
91+
height: $navtab-shadow-height;
92+
background: linear-gradient(to bottom, var(--navtab-shadow), rgba(#000, 0));
93+
pointer-events: none;
94+
}
7995
}
8096

8197
.bottomBar {

website/src/views/layout/Navbar.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ import GlobalSearchContainer from './GlobalSearchContainer';
1010
import styles from './Navbar.scss';
1111
import Navtabs from './Navtabs';
1212

13-
const Navbar: FC = ({ children }) => {
13+
const Navbar: FC = () => {
1414
return (
1515
<div className={styles.navbarWrapper}>
1616
{/* Bottom bar must be above the top bar in HTML, so that top bar can be interacted with. */}
1717
<nav className={styles.topBar}>
1818
<div className={styles.navLeft}>
19-
<NavLink className={styles.brand} to="/" title="Home">
20-
<Logo className={styles.brandLogo} title="NUSMods" />
21-
</NavLink>
19+
<NavLogo />
2220
<ErrorBoundary>
2321
<GlobalSearchContainer />
2422
</ErrorBoundary>
@@ -36,3 +34,11 @@ const Navbar: FC = ({ children }) => {
3634
// <div className={styles.weekText}>{weekText}</div>
3735

3836
export default Navbar;
37+
38+
const NavLogo: FC = () => {
39+
return (
40+
<NavLink className={styles.brand} to="/" title="Home">
41+
<Logo className={styles.brandLogo} title="NUSMods" />
42+
</NavLink>
43+
);
44+
};

website/src/views/layout/Navtabs.scss

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,38 +16,6 @@
1616
align-items: stretch;
1717
height: $navtab-height;
1818
margin: 0 auto;
19-
20-
// @include media-breakpoint-up(md) {
21-
// flex-direction: column;
22-
// justify-content: flex-start;
23-
// margin-top: 0.5rem;
24-
// box-shadow: none;
25-
// }
26-
27-
// @include media-breakpoint-up(xl) {
28-
// margin-top: 1rem;
29-
// }
30-
31-
@include media-breakpoint-down(sm) {
32-
position: sticky;
33-
top: 0;
34-
right: 0;
35-
left: 0;
36-
background-color: var(--body-bg);
37-
38-
// Fake shadow - can't use box shadow because they will appear on top of the
39-
// top nav bar
40-
&::after {
41-
content: '';
42-
position: absolute;
43-
right: 0;
44-
bottom: -$navtab-shadow-height;
45-
left: 0;
46-
height: $navtab-shadow-height;
47-
background: linear-gradient(to bottom, var(--navtab-shadow), rgba(#000, 0));
48-
pointer-events: none;
49-
}
50-
}
5119
}
5220

5321
.link {

0 commit comments

Comments
 (0)