Skip to content
Closed
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
2 changes: 1 addition & 1 deletion assets/js/sidebar-load-width.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

if (cssStyles) {
var styleTag = document.createElement("style");
styleTag.innerHTML = ".td-resizable-grid .td-main > .row.flex-xl-nowrap {" + cssStyles + "}";
styleTag.innerHTML = ".r-grid-container {" + cssStyles + "}";
document.head.appendChild(styleTag);
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion assets/js/sidebar-resizer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function () {
document.addEventListener("DOMContentLoaded", () => {
const gridContainer = document.querySelector(".td-resizable-grid .td-main > .row.flex-xl-nowrap");
const gridContainer = document.querySelector(".r-grid-container");
const leftResizer = document.getElementById("left-resizer");
const rightResizer = document.getElementById("right-resizer");

Expand Down
99 changes: 99 additions & 0 deletions assets/scss/_layout-resizers.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Left sidebar & Right sidebar Resize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The newly created stylesheet _layout-resizers.scss is not imported in _styles_project.scss or any other main stylesheet. This will prevent these styles from being compiled and applied to the site. Please add @import "layout-resizers.scss"; to _styles_project.scss to ensure the styles are included.

:root {
--left-sidebar-width: 240px;
--toc-width: 240px;

--left-sidebar-min-width: 180px;
--left-sidebar-max-width: 500px;

--toc-min-width: 180px;
--toc-max-width: 400px;

--sidebar-resize-width: 5px;
}

.layout-resizer {
width: var(--sidebar-resize-width);
cursor: col-resize;
background-color: transparent;
transition: background-color 0.15s ease;
z-index: 1; //Must be lower than the sticky header
}

.layout-resizer:hover,
.layout-resizer.is-dragging {
background-color: #00b39f;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid hardcoding the color value #00b39f here. Since this file will be imported into the main stylesheet where $primary is defined, you should continue using the $primary variable to maintain consistency and ensure that any future theme changes propagate automatically.

Suggested change
background-color: #00b39f;
background-color: $primary;

}

.r-grid-container .r-sidebar,
.r-grid-container .r-sidebar-toc,
.r-grid-container .r-main {
width: auto;
}

@media (min-width: 768px) {
.r-grid-container {
display: grid;
grid-template-columns:
var(--left-sidebar-width)
var(--sidebar-resize-width)
1fr;
}

.r-sidebar {
grid-column: 1;
grid-row: 1;
}

#left-resizer {
grid-column: 2;
grid-row: 1;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
}

.r-main {
grid-column: 3;
grid-row: 1;
}
}

@media (min-width: 1200px) {
.r-grid-container {
display: grid;
grid-template-columns:
var(--left-sidebar-width)
var(--sidebar-resize-width)
1fr
var(--sidebar-resize-width)
var(--toc-width);


#right-resizer {
grid-column: 4;
grid-row: 1;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
}

.r-sidebar-toc {
grid-column: 5;
grid-row: 1;
}

&--without-toc {
display: grid;
grid-template-columns:
var(--left-sidebar-width)
var(--sidebar-resize-width)
1fr;

#right-resizer,
.r-grid-container {
display: none;
}
}
}
}
93 changes: 4 additions & 89 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@import "elements_project";
@import "summary.scss";
@import "_kanvas-corner-popup.scss";
@import "_layout-resizers.scss";

.navbar-dark {
min-height: 5rem;
Expand Down Expand Up @@ -394,92 +395,6 @@ a:not([href]):not([class]):hover {
}
}

// Left sidebar & Right sidebar Resize
:root {
--left-sidebar-width: 240px;
--toc-width: 240px;

--left-sidebar-min-width: 180px;
--left-sidebar-max-width: 500px;

--toc-min-width: 180px;
--toc-max-width: 400px;

--sidebar-resize-width: 5px;
}

.layout-resizer {
width: var(--sidebar-resize-width);
cursor: col-resize;
background-color: rgba(0, 0, 0, 0.03);
transition: background-color 0.15s ease;
z-index: 1; //Must be lower than the sticky header
}

.layout-resizer:hover,
.layout-resizer.is-dragging {
background-color: $primary;
}

.td-resizable-grid .td-sidebar,
.td-resizable-grid .td-sidebar-toc,
.td-resizable-grid main[role="main"] {
width: auto;
}

@media (min-width: 768px) {
.td-resizable-grid .td-main > .row.flex-xl-nowrap {
display: grid;
grid-template-columns:
var(--left-sidebar-width)
var(--sidebar-resize-width)
1fr;
}

.td-sidebar {
grid-column: 1;
grid-row: 1;
}

#left-resizer {
grid-column: 2;
grid-row: 1;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
}

main[role="main"] {
grid-column: 3;
grid-row: 1;
}
}

@media (min-width: 1200px) {
.td-resizable-grid .td-main > .row.flex-xl-nowrap {
display: grid;
grid-template-columns:
var(--left-sidebar-width)
var(--sidebar-resize-width)
1fr
var(--sidebar-resize-width)
var(--toc-width);
}

#right-resizer {
grid-column: 4;
grid-row: 1;
padding-left: 0;
padding-right: 0;
box-sizing: border-box;
}

.td-sidebar-toc {
grid-column: 5;
grid-row: 1;
}
}

// pageinfo
.pageinfo {
font-weight: $font-weight-medium;
Expand Down Expand Up @@ -610,7 +525,7 @@ a:not([href]):not([class]):hover {
margin-bottom: 4rem;
font-size: 5rem;
text-align: left;
background-image:
background-image:
linear-gradient(to right, rgba(255, 255, 255, .9) 0px, rgb(0, 211, 169) 34%, rgb(235, 192, 23) 71%, rgb(255,243,197) 100%);
background-position:
0% 0%,
Expand Down Expand Up @@ -706,11 +621,11 @@ a:not([href]):not([class]):hover {
.dash-sign-container {
display: flex;
align-items: center;
justify-content: space-between;
justify-content: space-between;
text-align: right;

h1.dashboard {
max-width: 70%;
max-width: 70%;
text-align: left;
flex-shrink: 0;
@media (max-width: 768px) {
Expand Down
9 changes: 5 additions & 4 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@
<header>{{ partial "navbar.html" . }}</header>
<div class="container-fluid td-outer td-resizable-grid">
<div class="td-main">
<div class="row flex-xl-nowrap">
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none">
<div class="row flex-xl-nowrap r-grid-container">
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none r-sidebar">
{{ partial "sidebar.html" . }}
</aside>

<div class="layout-resizer d-none d-md-block" id="left-resizer"></div>

<div class="layout-resizer d-none d-xl-block" id="right-resizer"></div>
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none">

<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none r-sidebar-toc">
{{ partial "page-meta-links.html" . }}
{{ partial "toc.html" . }}
{{ partial "taxonomy_terms_clouds.html" . }}
</aside>

<main class="col-12 col-md-9 col-xl-8" role="main">
<main class="col-12 col-md-9 col-xl-8 r-main" role="main">
{{ partial "version-banner.html" . }}
<div class="page-header d-flex justify-content-between align-items-center">
{{ if not .Site.Params.ui.breadcrumb_disable }}
Expand Down
Loading