Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/npm_and_yarn/elliptic-6.5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminParisel authored Sep 25, 2024
2 parents b18f9aa + c23552b commit a357b4f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/helpers/isMessageBlockDisplayed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
'use strict'

module.exports = (page) => {
// To keep in sync with the message blocks that are supported (see partials/toolbar.hbs)
return page.attributes?.['next-release'] ||
page.attributes?.['custom-message'] ||
page.attributes?.['out-of-support']
}
2 changes: 1 addition & 1 deletion src/partials/toc.hbs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<aside class="toc sidebar" data-title="{{or page.attributes.toctitle 'Contents'}}" data-levels="{{{or page.attributes.toclevels 2}}}">
<aside class="toc sidebar{{#if (isMessageBlockDisplayed page)}} toc-with-message-block{{/if}}" data-title="{{or page.attributes.toctitle 'Contents'}}" data-levels="{{{or page.attributes.toclevels 2}}}">
<div class="toc-menu"></div>
</aside>
2 changes: 2 additions & 0 deletions src/partials/toolbar.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{{/if}}
</div>

{{!-- START support for message blocks - to keep in sync with the 'isMessageBlockDisplayed' helper --}}
{{#if page.attributes.next-release}}
<div class="paragraph message-block next-release-block">
<p>This content is dedicated to our next version.
Expand All @@ -45,6 +46,7 @@
<p>You may want to view the same page for the <a href="{{{relativize page.latest.url}}}">latest version</a>, or for any of the versions available in the drop-down menu in the top-right corner.</p>
</div>
{{/if}}
{{!-- END support for message blocks --}}

{{/unless}}
</div>
4 changes: 3 additions & 1 deletion src/stylesheets/globals/vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@
--nav-panel-height: calc(var(--nav-height) - var(--drawer-height));
--nav-panel-height--desktop: calc(var(--nav-height--desktop) - var(--drawer-height));
--nav-width: calc(270 / var(--rem-base) * 1rem);
--toc-top: calc(var(--body-top) + var(--toolbar-height) + var(--header-message-height));
--toc-top: calc(var(--body-top) + var(--toolbar-height));
--toc-top-with-message-block: calc(var(--toc-top) + var(--header-message-height));
--toc-height: calc(100vh - var(--toc-top) - 2.5rem);
--toc-height-with-message-block: calc(var(--toc-height) - var(--header-message-height));
--toc-width: calc(162 / var(--rem-base) * 1rem);
--toc-width--widescreen: calc(216 / var(--rem-base) * 1rem);
--doc-max-width: calc(720 / var(--rem-base) * 1rem);
Expand Down
9 changes: 9 additions & 0 deletions src/stylesheets/toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@
}
}
}
.toc-with-message-block.sidebar {
.toc-menu {
top: var(--toc-top-with-message-block);
}

ul {
max-height: var(--toc-height-with-message-block);
}
}

.toc {
.toc-menu {
Expand Down

0 comments on commit a357b4f

Please sign in to comment.