Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Sidebar implementation #116

Merged
merged 7 commits into from
Jan 24, 2025
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
310 changes: 306 additions & 4 deletions assets/css/v2/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
--color-background: #FFFFFF;
--color-foreground: #000000;
--color-shadow: #D2D2D2;
--color-product-title: #8D8D8D;

--sidebar-margin: 3rem;
--sidebar-line-box-side-length: 0.5rem;
--sidebar-line-box-top: 0.375rem;
--sidebar-line-box-left: 0.75rem;
--sidebar-width: 24rem;
--side-gutter-width: 20rem;
--text-content-width-iphone-13: 30rem;
Expand All @@ -30,7 +35,6 @@
@supports (font-variation-settings: normal) {
:root {
font-family: InterVariable, sans-serif;
font-variation-settings: 'wght' 350;
}

h1, h2, h3, h4, h5, h6, .breadcrumb {
Expand All @@ -43,6 +47,11 @@ h1, h2, h3, h4, h5, h6, .breadcrumb {
}

/* header */
p {
font-weight: 400;
}

/* layout */
header {
margin: 2rem 2rem;

Expand Down Expand Up @@ -110,6 +119,90 @@ nav {
}
}

/* main content */
.docs-container * {
box-sizing: border-box;
}

.content-layout {
display: grid;
grid-template-columns: var(--text-content-width-iphone-13) var(--side-gutter-width);
column-gap: var(--component-gap);
}

.docs-container {
min-width: 100%;
}

.main-layout {
display: grid;
grid-template-columns: 1fr;
}

.sidebar-layout {
display: flex;
flex-direction: column;
z-index: 9999;
}

@media (max-width: 1512px){
.sidebar-layout {
display: none;
}
}

.text-content {
grid-column-start: 1;
}

@media (min-width: 1512px) { /* Macbook Pro 14 */
.main-layout {
display: grid;
grid-template-columns: var(--sidebar-width) 1fr;
column-gap: var(--component-gap);
}

.content-layout {
display: grid;
grid-template-columns: var(--text-content-width-mbp-14) var(--side-gutter-width);
column-gap: var(--component-gap);
}

.content-layout .side-gutter {
grid-column-start: 2;
}

.base-layout {
display: grid;
grid-template-rows: repeat(2, auto);
column-gap: var(--component-gap);
}

.breadcrumb-layout {
display: grid;
grid-template-columns: var(--sidebar-width) 1fr;
column-gap: var(--component-gap);
align-items: center;
margin: 0 2rem;
}
}

@media (min-width: 1728px) { /* Macbook Pro 16 */
.content-layout {
display: grid;
grid-template-columns: var(--text-content-width-mbp-16) var(--side-gutter-width);
column-gap: var(--component-gap);
}
}

@media (min-width: 2560px) { /* 4k Desktop */
.content-layout {
display: grid;
grid-template-columns: var(--text-content-width-4k-display) var(--side-gutter-width);
column-gap: var(--component-gap);
}
}

#searchbox {
width: 24rem;
display:none;
Expand Down Expand Up @@ -201,9 +294,204 @@ nav {
}

.sidebar {
flex-basis: 1;
width: 20rem;
margin: 2rem 0;
display: flex;
flex-direction: column;
width: 24rem;
position: sticky;
top: 0;
}

.sidebar .product-selector-button {
display: flex;
align-items: center;
justify-content: space-between;
background-color: var(--color-brand);
color: var(--color-brand-100);
border: none;
font-weight: 500;
font-size: 1.25rem;
width: 100%;
padding: 0.5rem;
cursor: pointer;
}

.sidebar .product-selector-button .selector-icon {
height:24px;
width: 24px;
}

.product-selector {
display: none;
position: absolute;
top: 0;
min-width: 80%;
margin-left: 46rem;
padding: 0.75rem;
background-color: white;
border: black 1px solid;
box-shadow: 3px 3px 0px var(--color-shadow);
}

.product-selector p {
font-size: 0.75rem;
color: var(--color-product-title);
display: inline;
}

.product-selector ul {
padding-left: 0;
margin-top: 0;
list-style-type: none;
}

.product-selector a {
text-decoration: none;
color: black;
font-size: 1rem;
}

.sidebar .sidebar-navigation {
width: 100%;
font-weight: 500;
margin-left: var(--sidebar-margin);
}

/* removes the built in ul padding/margin */
.sidebar .sidebar-navigation ul {
margin-left: 0;
padding-left: 0;
list-style-type: none;
}

.sidebar ul :not(.sidebar-navigation) ul {
padding-left: 1rem;
}

.sidebar .sidebar-navigation li {
margin-bottom: 1rem;
}

.sidebar .sidebar-navigation a {
text-decoration: none;
color: black;
}

.sidebar .sidebar-navigation .collapsible-header {
cursor: pointer;
}

.sidebar .sidebar-navigation .collapsible-content {
display: none;
position: relative;
}

.sidebar .sidebar-navigation .box.opened {
display: none;
}

.toggle-checkbox:checked ~ .collapsible-header .box.expand {
display: none;
}

.toggle-checkbox:checked ~ .collapsible-content {
display: block;
}

.toggle-checkbox:checked ~ .collapsible-header .box.opened {
display: block;
}

/* Every other Sidebar Partial Vertical Line */
.toggle-checkbox:checked ~ .collapsible-content::before {
content: '';
position: absolute;
border-left: black 1px solid;
left: -0.525rem;
top: -1.33rem;
height: calc(100% + 0.78rem);
}

/* Every other Sidebar Partial Horizontal Lines */
.toggle-checkbox:checked ~ .collapsible-content li {
position: relative;
}

.toggle-checkbox:checked ~ .collapsible-content li::after {
content: '';
position: absolute;
border-top: black 1px solid;
left: -1.5rem;
width: 0.75rem;
top: 0.6rem;
}

.selected {
font-weight: 800;
}

.sidebar .sidebar-navigation li:first-child {
margin-top: 1rem;
}

.sidebar .sidebar-navigation ul li .box-link {
content: '';
background-color: black;
position: absolute;
width: 0.1rem;
height: var(--sidebar-line-box-side-length);
margin-top: var(--sidebar-line-box-top);
left: var(--sidebar-line-box-left);
}

.sidebar .sidebar-navigation ul li .box {
content: '';
position: absolute;
width: var(--sidebar-line-box-side-length);
height: var(--sidebar-line-box-side-length);
margin-top: var(--sidebar-line-box-top);
left: var(--sidebar-line-box-left);
}

.sidebar .sidebar-navigation ul li .expand {
background-color: black;
}

.sidebar .sidebar-navigation ul li .opened {
border: black 1px solid;
}

.sidebar .sidebar-navigation ul li .current {
background-color: var(--color-brand);
z-index: 999;
}

.sidebar .sidebar-navigation ul li .partial-box {
margin-left: -1.5rem;
}

.sidebar .sidebar-navigation ul li .partial {
left: -0.8125rem;
}

/* First Sidebar Nav Vertical Line */
.sidebar .sidebar-navigation .parent-collapsible-content::before{
content: '';
position: absolute;
border-left: black 1px solid;
left: 0;
bottom: 1.55rem;
height: calc(100% - 5.65rem);
}

/* First Sidebar Nav Horizontal Lines */
.sidebar .sidebar-navigation .parent-collapsible-content .parent-collapsible-content-item::before,
.sidebar .sidebar-navigation .parent-collapsible-content .parent-collapsible-content-item::after {
content: '';
position: absolute;
border-top: black 1px solid;
left: 0;
margin-top: 0.6rem;
width: 0.75rem;
}

.row {
Expand All @@ -214,6 +502,7 @@ nav {

/* content */
main {
flex: 1;
max-width: 50rem;
min-width: 40rem;
margin: 2rem 2rem;
Expand Down Expand Up @@ -313,6 +602,16 @@ pre.chroma {
width: 156px;
}

.f5-logo-footer {
height: 32px;
width: 32px;
}

.nginx-logo-footer {
height: 72x;
width: 156px;
}

/* FILTHY HACKS BEGIN */

/* Override logo with black text version */
Expand All @@ -326,6 +625,9 @@ pre.chroma {
background-size: contain;
background-position: left center;
width: 200px; /* Adjust the width as needed to fit the logo */
background-size: contain;
background-position: left center;
width: 200px; /* Adjust the width as needed to fit the logo */

img {
display: none;
Expand Down
17 changes: 17 additions & 0 deletions assets/js/product-selector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$(document).ready(function () {
const productSelectorContent = document.getElementById("product-selector");

$("#product-selector-button").on("click", () => {
if (productSelectorContent.style.display === "block") {
productSelectorContent.style.display = "none";
} else {
productSelectorContent.style.display = "block";
}
});

window.onclick = function(event) {
if (!event.target.matches('#product-selector-button') && !event.target.matches('#product-selector-button-icon')) {
productSelectorContent.style.display = "none"
}
}
})
File renamed without changes.
Loading