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 website] Fix docs layout and link bugs [Fixes #14436] #14439

Merged
merged 1 commit into from
Jul 26, 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
95 changes: 51 additions & 44 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

--navHeight: 4.5rem;
--sideWidth: 300px;
--maxWidth: 80rem;
--desktopInlinePadding: 2rem;
--mobileInlinePadding: 1rem;
--currentVersionHeight: 45px;

text-rendering: geometricPrecision;
Expand Down Expand Up @@ -57,7 +60,6 @@ html,
body,
.wy-grid-for-nav {
background-color: var(--color-f) !important;
position: relative;
}

body {
Expand All @@ -68,6 +70,10 @@ a {
color: var(--color-c);
}

a, section {
scroll-margin-top: calc(var(--navHeight) + 2rem);
}

hr {
margin-block: 2rem;
border-color: var(--color-d) !important;
Expand Down Expand Up @@ -328,7 +334,6 @@ ul.current ul,

.wy-breadcrumbs-aside a,
.wy-breadcrumbs-aside a:visited,
/* .wy-breadcrumbs-aside a:not(:visited), */
a.fa.fa-github,
a.fa.fa-github:visited,
a.fa.fa-github:not(:visited),
Expand Down Expand Up @@ -362,10 +367,11 @@ footer .rst-footer-buttons {

/* Site wrapper, and two children: header and rest */
.unified-wrapper {
position: fixed;
position: relative;
display: flex;
flex-direction: column;
inset: 0;
top: var(--navHeight);
max-width: 80rem;
max-width: var(--maxWidth);
margin-inline: auto;
}

Expand All @@ -378,17 +384,16 @@ footer .rst-footer-buttons {
display: flex;
align-items: center;
box-shadow: var(--shadow);
backdrop-filter: blur(3px);
}

.unified-header .inner-header {
display: flex;
margin-inline: auto;
width: 100%;
max-width: 80rem;
max-width: var(--maxWidth);
align-items: center;
justify-content: space-between;
padding-inline: 2rem;
padding-inline: var(--desktopInlinePadding);
padding-block: 1rem;
}

Expand All @@ -399,6 +404,7 @@ footer .rst-footer-buttons {
opacity: 95%;
background: var(--color-f);
z-index: -1;
backdrop-filter: blur(3px);
}

.unified-header .home-link {
Expand Down Expand Up @@ -445,6 +451,7 @@ footer .rst-footer-buttons {
font-weight: 400;
box-sizing: content-box;
border-bottom: 1px solid transparent;
white-space: nowrap;
}

.unified-header .nav-link.active {
Expand All @@ -456,34 +463,36 @@ footer .rst-footer-buttons {
border-bottom: 1px solid var(--color-c);
}

/* Rest: Grid, with two children: side bar, and content */
/* Rest: Flex-row, with two children: side bar, and content */
.unified-wrapper .wy-grid-for-nav {
position: relative !important;
display: grid !important;
grid-template-columns: var(--sideWidth) 1fr;
gap: 1rem;
display: flex;
margin-inline: auto;
}

/* First child: Side bar */
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side {
position: relative;
position: fixed;
display: flex;
flex-direction: column;
background: var(--color-f);
color: var(--color-a);
top: 0;
bottom: 0;
left: 0;
padding-bottom: unset !important;
min-height: unset !important;
z-index: 10 !important;
max-width: var(--sideWidth) !important;
min-height: unset !important;
width: var(--sideWidth) !important;
top: var(--navHeight);
bottom: 0;
left: auto;
overflow: auto;
}

.unified-wrapper .wy-grid-for-nav nav.wy-nav-side .wy-side-scroll {
position: relative !important;
width: fit-content !important;
position: static !important;
width: unset !important;
overflow: unset !important;
height: unset !important;
padding-bottom: 2rem;
}

.unified-wrapper .wy-grid-for-nav nav.wy-nav-side .wy-side-scroll .wy-side-nav-search {
Expand Down Expand Up @@ -517,15 +526,15 @@ footer .rst-footer-buttons {

/* Second child: Content */
.unified-wrapper .wy-grid-for-nav .wy-nav-content {
position: relative !important;
overflow-y: scroll !important;
width: 100%;
max-width: 100vw !important;
padding-inline: 2rem;
max-width: unset !important; /* override */
padding-inline: var(--desktopInlinePadding);
margin-inline-start: var(--sideWidth);
margin-top: var(--navHeight);
}

.unified-wrapper .wy-grid-for-nav .wy-nav-content .rst-content {
max-width: 70ch;
max-width: min(70ch, calc(100vw - 2 * var(--desktopInlinePadding) - var(--sideWidth)));
margin-inline: auto;
}

Expand Down Expand Up @@ -566,29 +575,15 @@ footer .rst-footer-buttons {
}

.unified-header .inner-header {
padding-inline: 1rem;
}

.unified-wrapper .wy-grid-for-nav {
grid-template-columns: 1fr;
padding-inline: var(--mobileInlinePadding);
}

.unified-wrapper .wy-grid-for-nav nav.wy-nav-side {
position: absolute;
inset-block: 0;
inset-inline-start: 0;
width: var(--sideWidth);
overflow-y: scroll;
transform: translateX(-100%);
transition: transform 200ms ease-in-out;
}

/* Menu open styles */
.unified-wrapper .wy-grid-for-nav nav.wy-nav-side {
position: absolute;

}

.unified-wrapper.menu-open nav.wy-nav-side {
transform: translateX(0);
transition: transform 200ms ease-in-out;
Expand All @@ -613,6 +608,18 @@ footer .rst-footer-buttons {
a.skip-to-content {
display: none;
}

.wy-nav-content {
margin-inline-start: 0 !important;
}

.rst-content {
max-width: 100% !important;
}

.wy-side-scroll {
padding-bottom: 0 !important;
}
}

ul.search .context {
Expand Down Expand Up @@ -781,9 +788,8 @@ button.mobile-menu-button {
font-family: 'Overpass Mono', monospace;
}

.wy-breadcrumbs-aside {
display: block;
padding-top: 0;
.wy-breadcrumbs>li {
padding-top: 8px;
}

.wy-breadcrumbs-aside a {
Expand All @@ -804,8 +810,9 @@ a.skip-to-content {
padding: 2px 4px;
font-size: 14px;
margin-inline-end: auto;
margin-inline-start: 2rem;
margin-inline-start: 1.5rem;
color: var(--color-a);
white-space: nowrap;
}

a.skip-to-content:focus {
Expand Down
Binary file removed docs/_static/fonts/overpass-bold.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-bold.woff2
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-italic.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-light.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-mono-bold.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-mono-bold.woff2
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-mono-regular.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-mono-regular.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-regular.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-regular.woff2
Binary file not shown.
Binary file removed docs/_static/fonts/overpass-semibold.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass/overpass-bold.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass/overpass-italic.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass/overpass-light.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass/overpass-regular.otf
Binary file not shown.
Binary file removed docs/_static/fonts/overpass/overpass-semibold.otf
Binary file not shown.
18 changes: 1 addition & 17 deletions docs/_static/js/initialize.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function buildHeader() {
const skipToContent = document.createElement("a");
skipToContent.classList.add("skip-to-content");
skipToContent.href = "#content";
skipToContent.innerText = "{ skip to content }";
skipToContent.innerText = "{skip to content}";
innerHeader.appendChild(skipToContent);

const navBar = document.createElement("nav");
Expand Down Expand Up @@ -157,22 +157,6 @@ function updateGitHubEditPath() {
}

function initialize() {
// Preload fonts
const fonts = [
"overpass-regular.otf",
"overpass-bold.otf",
"overpass-mono-regular.otf",
"overpass-mono-bold.otf",
];
fonts.forEach((filename) => {
const link = document.createElement("link");
link.rel = "preload";
link.as = "font";
link.href = `https://solidity-docs-dev.readthedocs.io/en/latest/_static/fonts/${filename}`;
link.crossOrigin = "";
document.head.appendChild(link);
});

// Rearrange DOM elements for styling
rearrangeDom();

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def setup(sphinx):
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
# directly to the root of the documentation.
html_extra_path = ["_static/css", "_static/fonts"]
html_extra_path = ["_static/css"]

# List of templates of static files to be included in the HTML output.
# Keys represent paths to input files and values are dicts containing:
Expand Down