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 highlight current page #632

Merged
merged 3 commits into from
Mar 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/web/src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</b-navbar-toggle>
<b-collapse id="header-navbar-collapse" is-nav>
<b-navbar-nav>
<b-nav-item :to="{ name: 'CourseScheduler' }">
<b-nav-item :to="{ name: 'CourseScheduler' }" class="first">
<font-awesome-icon icon="calendar" />
Schedule
</b-nav-item>
Expand Down Expand Up @@ -105,6 +105,7 @@ import {
import { mapState, mapActions, mapGetters } from "vuex";
import LoginComponent from "@/components/Login";
import { userTypes } from "../store/modules/user";
// import router from "@/routes";
export default {
name: "Header",
components: {
Expand Down Expand Up @@ -215,8 +216,20 @@ export default {
justify-content: center;
}
}
//highlight current page in the navbar using class built into vue router
.nav-item:not(.first) .router-link-active{
border-radius: 5px;
padding: calc(8px - 0.2em);
border: 0.2em solid var(--dark-blue-secondary);
}

.nav-item.first .router-link-exact-active{
border-radius: 5px;
padding: calc(8px - 0.2em);
border: 0.2em solid var(--dark-blue-secondary);
}
// no idea why but need to manually set this for it to show up
.dark #header-navbar-collapse-toggle {
color: var(--dark-text-primary) !important;
}
</style>
</style>