Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
45 changes: 32 additions & 13 deletions assets/scss/_sidebar-tree.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.td-sidebar-nav {
$_max-height: calc(100vh - 8.5rem);

padding: 0;
padding-right: 0.5rem;
margin-right: -15px;
margin-left: -15px;
Expand All @@ -19,7 +20,7 @@
@include media-breakpoint-up(lg) {
// There's no search box so add top padding
// and adjust max-height:
padding-top: 1rem;
padding-top: 0;

@supports (position: sticky) {
max-height: calc(#{$_max-height} + 4.5rem);
Expand Down Expand Up @@ -59,7 +60,8 @@
}

a {
color: var(--bs-secondary-color);
color: var(--sidebar-section-title-color);
transition: var(--sidebar-link-transition);
}
}

Expand All @@ -68,25 +70,40 @@
padding-bottom: 0.375rem;

&__page {
color: var(--bs-body-color);
font-weight: $font-weight-light;
color: var(--sidebar-link-color);
font-weight: var(--sidebar-link-font-weight);
transition: var(--sidebar-link-transition);
}
}

a {
color: var(--sidebar-link-color);
transition: var(--sidebar-link-transition);

&:focus,
&:hover {
color: var(--bs-link-color);
color: var(--sidebar-link-hover-color);
background-color: var(--sidebar-link-hover-bg);
border-radius: 4px;
padding: 0.25rem 0.5rem;
}

&.active {
font-weight: $font-weight-bold;
font-weight: var(--sidebar-active-link-font-weight);
color: var(--sidebar-link-active-color);
}
}

.dropdown {
a {
color: var(--bs-tertiary-color);
color: var(--sidebar-secondary-text-color);
transition: var(--sidebar-link-transition);

&:hover,
&:focus {
color: var(--sidebar-link-hover-color);
background-color: var(--sidebar-link-hover-bg);
}
}

.nav-link {
Expand Down Expand Up @@ -119,13 +136,14 @@
@include link-decoration;

@include media-breakpoint-up(md) {
padding-top: 4rem;
background-color: var(--bs-body-tertiary-bg);
padding-right: 1rem;
border-right: 1px solid var(--bs-border-color);
padding-top: 0;
background-color: var(--sidebar-bg-color);
padding-right: var(--sidebar-padding-horizontal);
padding-left: var(--sidebar-padding-horizontal);
border-right: var(--sidebar-border-width) solid var(--sidebar-border-color);
}

padding-bottom: 1rem;
padding-bottom: var(--sidebar-padding-vertical);

&__toggle {
line-height: 1;
Expand All @@ -134,7 +152,8 @@
}

&__search {
padding: 1rem 0;
padding: 0 0;
padding-bottom: 1rem;
}

&__inner {
Expand Down
36 changes: 21 additions & 15 deletions assets/scss/_styles_project.scss
Comment thread
PARTH-TUSSLE marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ a:not([href]):not([class]):hover {
height: calc(100vh - 5.5rem);
top: 5.5rem;
overflow-y: auto;
padding-top: 1rem;
padding-top: 0rem;
margin-top: 0;
overflow-x: hidden;
&__inner {
Expand Down Expand Up @@ -335,36 +335,42 @@ a:not([href]):not([class]):hover {
.td-sidebar-toc {
margin-top: 0rem;
line-height: 1.25rem;
border-left: 1px solid $border-color;
background-image: linear-gradient(to top,
#1e2117,
#1d1912,
#18120e,
#0f0a09,
#000000);
border-left: var(--sidebar-border-width) solid var(--sidebar-border-color);
background-color: var(--sidebar-bg-color);
padding-left: var(--sidebar-padding-horizontal);
padding-right: var(--sidebar-padding-horizontal);

@supports (position: sticky) {
position: sticky;
top: 5.5rem;
padding-top: 1rem;
padding-top: var(--sidebar-padding-vertical);
height: calc(100vh - 5.5rem);
overflow-y: auto;
}

.taxo-categories {
margin-top: 2rem;
}

@media screen and (max-width: 768px) {
@supports (position: sticky) {
top: 0;
padding-top: 0;
height: auto;
}
}
}

.td-page-meta {
a {
display: block;
color: $gray-400;
color: var(--sidebar-secondary-text-color);
line-height: 1.65rem;
font-weight: $font-weight-medium;
transition: var(--sidebar-link-transition);

&:hover {
color: $white;
color: var(--sidebar-link-hover-color);
text-decoration: none;
}
}
Expand All @@ -379,16 +385,16 @@ a:not([href]):not([class]):hover {

#TableOfContents {
a {
color: $lightslategray;
color: var(--sidebar-secondary-text-color);
padding: 0.25rem 0.5rem;
border-radius: 4px;
transition: background-color 0.2s ease, color 0.2s ease;
transition: var(--sidebar-link-transition);

&:hover,
&:focus-visible {
color: $white;
color: var(--sidebar-link-hover-color);
text-decoration: none;
background-color: rgba($primary, 0.15);
background-color: var(--sidebar-link-hover-bg);
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions assets/scss/_variables_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,34 @@ $td-sidebar-border-color: $border-color;
// Righthand sidebar with intra-page table of contents
$td-sidebar-toc-bg-color: rgba($dark, 0.5);


// Variables for Consistent Sidebar Styling
:root {
// Colors
--sidebar-bg-color: rgba(18, 18, 18, 0.7);
--sidebar-border-color: rgba(0, 179, 159, 0.33);
--sidebar-text-color: #cccccc;
--sidebar-link-color: #cccccc;
--sidebar-link-hover-color: #ffffff;
--sidebar-link-active-color: #ffffff;
--sidebar-secondary-text-color: #cccccc;

// Spacing
--sidebar-padding-vertical: 1rem;
--sidebar-padding-horizontal: 1rem;
--sidebar-border-width: 1px;

// Fonts
--sidebar-section-title-color: var(--bs-secondary-color);
--sidebar-link-font-weight: 300;
--sidebar-active-link-font-weight: 700;

// Interactions
--sidebar-link-transition: color 0.2s ease, background-color 0.2s ease;
--sidebar-link-hover-bg: rgba(0, 211, 169, 0.1);
--sidebar-link-focus-bg: rgba(0, 211, 169, 0.15);
}

// Background colors for the sections on home page etc. It is a paint by number
// system, starting at 0, where the number is taken from the shortcode's ordinal
// if not provided by the user. These colors are all part of the theme palette,
Expand Down Expand Up @@ -117,6 +145,7 @@ $navbar-dark-hover-color: rgba($white, 0.35) !default;
// Layout

$site-max-width: 1920px;
$sidebar-top-alignment: 1rem;

// Footer

Expand Down
Loading