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

[docs] Address anchor linking issue #5795

Merged
merged 1 commit into from
Mar 29, 2023
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
2 changes: 1 addition & 1 deletion docs/website/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function initBannerVersionWarningCloseButton() {
$(".banner-version-warning").find(".delete").click(function() {
$(".banner-version-warning").remove();
$(".dashboard-wrapper").addClass("banner-version-warning-dismissed");
});
}

Expand Down
29 changes: 15 additions & 14 deletions docs/website/assets/sass/docs.sass
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
$panel-header-logo-width: 85%

// this will add space before the target element so that the floating navbar
// doesn't cover it when following an anchor link
\:target::before
+desktop
content: ""
display: block
height: 4.25rem // height of the navbar + 1rem
.dashboard-main
.article
+desktop
// this is the height of the navbar and warning banner
max-height: calc(100vh - 10.5rem)
overflow: scroll
.dashboard-wrapper.banner-version-warning-dismissed
.dashboard-main
.article
+desktop
// this is the height of the warning banner only
max-height: calc(100vh - 3.5rem)

=flex
display: flex
Expand Down Expand Up @@ -172,7 +177,7 @@ $panel-header-logo-width: 85%

// this is used to make the banner appear in the same position as the page
// scrolls
position: fixed
position: sticky
width: 100%
z-index: 100

Expand All @@ -185,9 +190,5 @@ $panel-header-logo-width: 85%
&.is-info
border-image: 50 repeating-linear-gradient(75deg, #296fa8 0, #296fa8 1rem, transparent 0, transparent 2rem)

// the hidden clone of the message is used to 'push down' the dashboard
// when a message is being displayed by the correct amount
&.hidden
flex: 0 1 auto
visibility: hidden
position: relative
.dashboard-wrapper.banner-version-warning-dismissed .banner-version-warning
display: none
12 changes: 0 additions & 12 deletions docs/website/layouts/partials/docs/banner-version-warning.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
<button class="delete" aria-label="delete"></button>
</div>
</div>
<!-- this is here to add make sure the space in the dom is retained and pushes down the dashboard the correct amount-->
<div class="message is-danger banner-version-warning hidden">
<div class="message-body">
This version is still under development! Latest stable release is <a href="/docs/latest">{{ $latestVersionString }}</a>
</div>
</div>
{{- else if (and (ne $version $latest) (ne $version $latestVersionString)) }}
<div class="message {{ cond $ancient "is-danger" "is-warning"}} banner-version-warning">
<div class="message-body">
Expand All @@ -42,10 +36,4 @@
{{ end }}
</div>
</div>
<!-- this is here to add make sure the space in the dom is retained and pushes down the dashboard the correct amount-->
<div class="message {{ cond $ancient "is-danger" "is-warning"}} banner-version-warning hidden ">
<div class="message-body">
These are the docs for an older version of OPA ({{ $version }}). Latest stable release is <a href="/docs/latest">{{ $latestVersionString }}</a>
</div>
</div>
{{- end }}
1 change: 1 addition & 0 deletions docs/website/scripts/live-blocks/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.