Skip to content

fix: allow for hash link offsets with breadcrumbs #273

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

Merged
merged 4 commits into from
Aug 20, 2020
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions docs/.vuepress/theme/components/Breadcrumbs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@ export default {
}
</script>

<style lang="stylus">
// offset hash position for breadcrumb bar
h1, h2, h3, h4, h5, h6
{$contentClass}:not(.custom) > &
margin-top (0.5rem - ($navbarHeight + $breadcrumbsHeight)) !important
padding-top $navbarHeight + $breadcrumbsHeight + 1rem !important

.breadcrumbs.fixed + {$contentClass} {
padding-top: $breadcrumbsHeight - 0.5rem;
}
</style>

<style lang="stylus" scoped>
nav
border-bottom 1px solid #eaecef
Expand Down
43 changes: 25 additions & 18 deletions docs/.vuepress/theme/components/Home.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<main class="home">
<div class="theme-default-content">
<div class="home-container theme-default-content">
<Content class="intro" />
<div class="grid">
<div
Expand Down Expand Up @@ -36,7 +36,7 @@ import { isExternal } from '@parent-theme/util/'

export default {
name: 'Home',
data: function() {
data: function () {
return {
manualSidebar: [
{
Expand Down Expand Up @@ -95,7 +95,7 @@ export default {
}
]
},
{
{
title: 'Build',
path: '/build',
children: [
Expand All @@ -121,27 +121,28 @@ export default {
},
{
title: 'Filecoin community resources',
path: 'https://github.com/filecoin-project/docs/wiki#community-resources'
path:
'https://github.com/filecoin-project/docs/wiki#community-resources'
},
{
title: 'Component design system',
path: 'http://filecoin.onrender.com/'
}
]
},
{
title: 'Mine',
path: '/mine',
children: [
{
{
title: 'Mine',
path: '/mine',
children: [
{
title: 'Mining overview',
path: '/mine/'
},
{
{
title: 'Improving connectivity',
path: '/mine/connectivity'
},
{
{
title: 'Space Race',
path: '/mine/spacerace'
}
Expand Down Expand Up @@ -232,15 +233,21 @@ export default {
}
</script>

<style lang="stylus">
.home .header-anchor {
display: none
}
</style>

<style lang="stylus" scoped>
.home .theme-default-content:not(.custom) {
padding: 2rem 2.5rem 6rem;
max-width: 740px;
background: no-repeat url("/images/main-page-background.png");
background-position: 550px 34px;
background-size: 280px 336px;
@media (min-width: $MQNarrow) {
.home {$contentClass}:not(.custom) {
background: no-repeat url("/images/main-page-background.png");
background-position: right 3rem;
background-size: 280px 336px;
}
}
.home .theme-default-content:not(.custom) > h1:first-child {
.home {$contentClass}:not(.custom) > h1:first-child {
font-weight: normal;
margin: 0 0 3rem;
}
Expand Down
4 changes: 0 additions & 4 deletions docs/.vuepress/theme/components/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ export default {
display: block;
}

.breadcrumbs.fixed + .theme-default-content {
padding-top: 6em;
}

.content-footer {
padding-top: 0;
max-width: $contentWidth;
Expand Down
2 changes: 2 additions & 0 deletions docs/.vuepress/theme/styles/palette.styl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ $badgeInfoColorLight = #e6F6ff;
$badgeInfoColorDark = #0e74aa;
// layout
$navbarHeight = 4rem;
$breadcrumbsHeight = 4.5rem;
$sidebarWidth = 19rem;
$contentWidth = 740px;
$contentClass = '.theme-default-content';
// responsive breakpoints
$MQNarrow = 959px;
$MQMobile = 719px;
Expand Down