Skip to content

Commit 078da7e

Browse files
authored
Merge pull request #273 from filecoin-project/fix/239
fix: allow for hash link offsets with breadcrumbs
2 parents 644d550 + 38b97a5 commit 078da7e

File tree

4 files changed

+39
-22
lines changed

4 files changed

+39
-22
lines changed

docs/.vuepress/theme/components/Breadcrumbs.vue

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ export default {
4242
}
4343
</script>
4444

45+
<style lang="stylus">
46+
// offset hash position for breadcrumb bar
47+
h1, h2, h3, h4, h5, h6
48+
{$contentClass}:not(.custom) > &
49+
margin-top (0.5rem - ($navbarHeight + $breadcrumbsHeight)) !important
50+
padding-top $navbarHeight + $breadcrumbsHeight + 1rem !important
51+
52+
.breadcrumbs.fixed + {$contentClass} {
53+
padding-top: $breadcrumbsHeight - 0.5rem;
54+
}
55+
</style>
56+
4557
<style lang="stylus" scoped>
4658
nav
4759
border-bottom 1px solid #eaecef

docs/.vuepress/theme/components/Home.vue

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<main class="home">
3-
<div class="theme-default-content">
3+
<div class="home-container theme-default-content">
44
<Content class="intro" />
55
<div class="grid">
66
<div
@@ -36,7 +36,7 @@ import { isExternal } from '@parent-theme/util/'
3636
3737
export default {
3838
name: 'Home',
39-
data: function() {
39+
data: function () {
4040
return {
4141
manualSidebar: [
4242
{
@@ -95,7 +95,7 @@ export default {
9595
}
9696
]
9797
},
98-
{
98+
{
9999
title: 'Build',
100100
path: '/build',
101101
children: [
@@ -121,27 +121,28 @@ export default {
121121
},
122122
{
123123
title: 'Filecoin community resources',
124-
path: 'https://github.com/filecoin-project/docs/wiki#community-resources'
124+
path:
125+
'https://github.com/filecoin-project/docs/wiki#community-resources'
125126
},
126127
{
127128
title: 'Component design system',
128129
path: 'http://filecoin.onrender.com/'
129130
}
130131
]
131132
},
132-
{
133-
title: 'Mine',
134-
path: '/mine',
135-
children: [
136-
{
133+
{
134+
title: 'Mine',
135+
path: '/mine',
136+
children: [
137+
{
137138
title: 'Mining overview',
138139
path: '/mine/'
139140
},
140-
{
141+
{
141142
title: 'Improving connectivity',
142143
path: '/mine/connectivity'
143144
},
144-
{
145+
{
145146
title: 'Space Race',
146147
path: '/mine/spacerace'
147148
}
@@ -232,15 +233,21 @@ export default {
232233
}
233234
</script>
234235

236+
<style lang="stylus">
237+
.home .header-anchor {
238+
display: none
239+
}
240+
</style>
241+
235242
<style lang="stylus" scoped>
236-
.home .theme-default-content:not(.custom) {
237-
padding: 2rem 2.5rem 6rem;
238-
max-width: 740px;
239-
background: no-repeat url("/images/main-page-background.png");
240-
background-position: 550px 34px;
241-
background-size: 280px 336px;
243+
@media (min-width: $MQNarrow) {
244+
.home {$contentClass}:not(.custom) {
245+
background: no-repeat url("/images/main-page-background.png");
246+
background-position: right 3rem;
247+
background-size: 280px 336px;
248+
}
242249
}
243-
.home .theme-default-content:not(.custom) > h1:first-child {
250+
.home {$contentClass}:not(.custom) > h1:first-child {
244251
font-weight: normal;
245252
margin: 0 0 3rem;
246253
}

docs/.vuepress/theme/components/Page.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ export default {
9292
display: block;
9393
}
9494
95-
.breadcrumbs.fixed + .theme-default-content {
96-
padding-top: 6em;
97-
}
98-
9995
.content-footer {
10096
padding-top: 0;
10197
max-width: $contentWidth;

docs/.vuepress/theme/styles/palette.styl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ $badgeInfoColorLight = #e6F6ff;
1717
$badgeInfoColorDark = #0e74aa;
1818
// layout
1919
$navbarHeight = 4rem;
20+
$breadcrumbsHeight = 4.5rem;
2021
$sidebarWidth = 19rem;
2122
$contentWidth = 740px;
23+
$contentClass = '.theme-default-content';
2224
// responsive breakpoints
2325
$MQNarrow = 959px;
2426
$MQMobile = 719px;

0 commit comments

Comments
 (0)