1
0
mirror of https://github.com/minio/docs.git synced 2025-07-28 19:42:10 +03:00

Fix headerlink and update code styles (#559)

This commit is contained in:
Rushan
2022-09-15 23:50:49 +04:00
committed by GitHub
parent 42bb882c8b
commit e3e22d332b
4 changed files with 54 additions and 18 deletions

View File

@ -368,4 +368,18 @@ window.addEventListener("DOMContentLoaded", (event) => {
}); });
} }
})(); })();
// --------------------------------------------------
// Headerlink wrappers
// --------------------------------------------------
(function () {
const headerlinkEls = document.querySelectorAll(".headerlink");
if(headerlinkEls.length > 0) {
headerlinkEls.forEach((item) => {
var parent = item.parentNode;
parent.classList.add("headerlink-wrapper");
});
}
})();
}); });

View File

@ -72,17 +72,37 @@ div.sidebar {
&:hover { &:hover {
color: var(--text-color); color: var(--text-color);
} }
code {
background-color: var(--theme-light-bg);
color: var(--text-color);
font-size: $font-size-sm;
margin: -0.5rem 0;
transition: background-color 300ms, color 300ms;
padding: 0.2rem 0.45rem;
border-radius: $border-radius;
&:hover {
background-color: var(--theme-light-hover-bg);
opacity: 1;
}
}
} }
&.current > a, &.current > a,
& > a.current { & > a.current {
font-weight: $font-weight-medium; font-weight: $font-weight-medium;
color: var(--docs-nav-active-color); color: var(--docs-nav-active-color);
code {
color: var(--docs-nav-active-color);
background-color: var(--docs-nav-active-code-bg);
}
} }
} }
ul { ul {
margin-left: 1rem; margin: 0 0 0 1rem;
} }
} }
} }

View File

@ -39,7 +39,6 @@ h2, h3, h4, h5, h6 {
} }
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
position: relative;
line-height: 1.2; line-height: 1.2;
&, &,
@ -47,6 +46,7 @@ h1, h2, h3, h4, h5, h6 {
code { code {
color: var(--headings-color); color: var(--headings-color);
font-size: inherit; font-size: inherit;
padding: 0;
} }
} }
@ -57,12 +57,10 @@ h4 { font-size: 1rem; }
h5 { font-size: 1rem; } h5 { font-size: 1rem; }
h6 { font-size: 1rem; } h6 { font-size: 1rem; }
.content__main { *.headerlink-wrapper {
// Setting extra padding and margin to make room for anchors. position: relative;
h1, h2, h3, h4, h5 { padding-left: 1.5rem;
padding-left: 1.5rem; margin-left: -1.5rem;
margin-left: -1.5rem;
}
} }
a.headerlink { a.headerlink {
@ -117,20 +115,23 @@ code {
border: 0; border: 0;
} }
a { .content__main {
code.xref, a {
code { code.xref,
color: var(--code-link-color);
background-color: var(--code-link-bg);
transition: opacity 300ms;
}
&:hover {
code { code {
color: var(--code-link-color);
background-color: var(--code-link-bg); background-color: var(--code-link-bg);
opacity: 0.8; transition: opacity 300ms;
}
&:hover {
code {
background-color: var(--code-link-bg);
opacity: 0.8;
}
} }
} }
} }
.highlight { .highlight {

View File

@ -57,6 +57,7 @@ $theme-properties: (
// Docs nav // Docs nav
--docs-nav-active-color: $theme-red $headings-dark-color, --docs-nav-active-color: $theme-red $headings-dark-color,
--docs-nav-active-code-bg: #efdde0 #2E394A,
--docs-nav-group-border-color: $light-300 $dark-300, --docs-nav-group-border-color: $light-300 $dark-300,
// Scrollbar // Scrollbar