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

some opinionated layout changes to match other docs #1746

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
60 changes: 57 additions & 3 deletions docs/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
@import url("observablehq:theme-near-midnight.css") (prefers-color-scheme: dark);

:root {
--sans-serif: Inter, -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu, roboto,
noto, "segoe ui", arial, sans-serif;
--sans-serif: Inter, -apple-system, BlinkMacSystemFont, "avenir next", avenir, helvetica, "helvetica neue", ubuntu,
roboto, noto, "segoe ui", arial, sans-serif;
--monospace: "Spline Sans Mono", Menlo, Consolas, monospace;
--theme-foreground-focus: #148576;
--observablehq-header-height: 64px;
}

h1 code,
Expand Down Expand Up @@ -34,6 +35,22 @@ code:not(pre code, h1 code, h2 code, h3 code, h4 code, h5 code, h6 code) {
}
}

#observablehq-header {
padding: 0;
left: calc(max(0rem, (100vw - var(--observablehq-max-width)) / 2) + 2rem);
right: calc(max(0rem, (100vw - var(--observablehq-max-width)) / 2) + 2rem);
}

#observablehq-header > div:first-child {
display: flex;
flex-grow: 1;
align-items: center;
justify-content: space-between;
white-space: nowrap;
margin-left: 2rem;
margin-right: 2rem;
}

#observablehq-header a[href] {
color: inherit;
}
Expand Down Expand Up @@ -72,8 +89,9 @@ body {
font: 16px/1.5 var(--sans-serif);
}

#observablehq-main {
#observablehq-header ~ #observablehq-main {
min-height: calc(100vh - 23.8rem);
margin-top: calc(var(--observablehq-header-height) + 2rem);
}

#observablehq-main a[href]:not(.observablehq-header-anchor) {
Expand All @@ -96,13 +114,25 @@ h1 {
.hide-if-small {
display: none !important;
}
#observablehq-header > div:first-child {
margin-left: 1.5rem;
margin-right: 0.5rem;
}
}

@media (min-width: calc(640px + 6rem + 272px)) {
#observablehq-sidebar-toggle:is(:checked, :indeterminate) ~ #observablehq-center .hide-if-sidebar {
display: none !important;
}
}
#observablehq-sidebar > ol:first-child {
padding: 0;
}

#observablehq-sidebar-close {
top: 0;
justify-content: right;
}

#observablehq-sidebar > ol:first-child > li::before {
display: none;
Expand All @@ -113,6 +143,30 @@ h1 {
color: inherit;
}

#observablehq-sidebar > * {
margin-left: 0.5rem !important;
margin-right: 0.5rem !important;
}

#observablehq-search {
margin-left: 1rem !important;
}

#observablehq-sidebar .observablehq-link-active::before {
left: -1rem;
}

#observablehq-sidebar .observablehq-link a,
#observablehq-sidebar summary {
margin-left: -1rem;
padding-left: 2rem;
}


#observablehq-header ~ #observablehq-toc {
top: calc(var(--observablehq-header-height));
}

a.observablehq-version-badge {
font: 500 12px var(--sans-serif);
display: inline-block;
Expand Down
4 changes: 2 additions & 2 deletions observablehq.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ export default {
: ""
}
<script type="module">/Win/.test(navigator.platform) || Array.from(document.querySelectorAll(".win"), (e) => e.remove())</script>`,
home: `<span style="display: flex; align-items: center; font-weight: 500; gap: 0.5rem; margin-left: -0.5rem; color: var(--theme-foreground);">
home: `<span style="display: flex; align-items: center; font-weight: 500; gap: 0.5rem; color: var(--theme-foreground);">
${logo()} Framework
</span>`,
header: `<div style="display: flex; flex-grow: 1; align-items: center; justify-content: space-between; white-space: nowrap;">
header: `<div>
<div>
<a href="/" class="hide-if-sidebar" style="display: flex; align-items: center; gap: 0.5rem;">
${logo()} Framework
Expand Down