Skip to content
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
144 changes: 61 additions & 83 deletions assets/scss/menu.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// (C) 2023 GoodData Corporation
// (C) 2025 GoodData Corporation
@import "variables/variables";

.td-sidebar {
Expand All @@ -14,15 +14,15 @@

.gd-docs-menu {
position: fixed;
top: $header-first-nav-height-desktop + 1px;
top: $header-first-nav-height + 1px;
bottom: 0;
left: -100%;
z-index: 32;
z-index: 33;
overflow: auto;
width: calc(100% - 55px);
flex: 1 1 auto;
padding: 0 20px 20px;
background: $color-mist-gray;
padding: 32px 40px;
background: #f8f8f8;
transition: $transition;

@include mq(large) {
Expand All @@ -34,7 +34,6 @@
z-index: 0;
width: 100%;
max-width: 380px;
padding: 32px 40px;

@supports(position: sticky) {
position: sticky;
Expand All @@ -47,64 +46,43 @@
opacity: 0;
}

&__mobile-btn {
&__mobile-trigger {
display: none;
}

&__mobile-icon {
position: fixed;
top: $header-first-nav-height-desktop;
left: 10px;
z-index: 34;
top: 80px;
display: flex;
justify-content: center;
align-items: center;
width: 55px;
height: $header-second-nav-height;
padding: 0;
background: transparent;
border: none;
left: 10px;
z-index: 34;
transition: $transition;
cursor: pointer;

&:focus {
outline: 2px solid $color-shocking-pink;
outline-offset: 2px;
}

@include mq(large) {
display: none;
}
}

&__mobile-icon {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 26px;
height: 22px;

&::before {
content: url("../img/burger.svg");
display: block;
width: 26px;
height: 22px;
}
}

&__mobile-btn[aria-expanded="true"] {
left: calc(100% - 55px);

.gd-docs-menu__mobile-icon::before {
display: none;
}

.gd-docs-menu__mobile-icon::after {
&::after {
content: "";
display: block;
display: none;
width: 31px;
height: 31px;
background-image: url("../img/close.svg");
background-repeat: no-repeat;
background-size: contain;
}

@include mq(large) {
display: none;
}
}

&__mobile-bg {
Expand All @@ -121,12 +99,23 @@
display: none;
}
}

&__mobile-btn[aria-expanded="true"] ~ &,
&__mobile-btn[aria-expanded="true"] ~ &__mobile-bg {
&__mobile-trigger:checked ~ &,
&__mobile-trigger:checked ~ &__mobile-bg {
left: 0;
}

&__mobile-trigger:checked ~ &__mobile-icon {
left: calc(100% - 55px);

&::before {
display: none;
}

&::after {
display: block;
}
}

& > &-section {
padding-left: 0;
}
Expand All @@ -150,14 +139,6 @@
}
}

&-section-wrapper {
display: none;

&.expanded {
display: block !important;
}
}

&-page__label ~ &-section {
padding-left: 0;
}
Expand Down Expand Up @@ -210,41 +191,23 @@
}
}

&__toggle-btn {
display: flex;
align-items: center;
justify-content: center;
&__toggle {
display: none;
}

&__chevron {
margin: 4px 0 0;
padding: 4px;
background: transparent;
border: none;
cursor: pointer;
transition: none;

// Add focus styles for keyboard navigation
&:focus {
outline: 2px solid -webkit-focus-ring-color;
outline-offset: 2px;
border-radius: 1px;
}

// SVG rotation based on expanded state
&[aria-expanded="false"] .gd-docs-menu-page__chevron svg {

svg {
transform: rotate(180deg);
}

&[aria-expanded="true"] .gd-docs-menu-page__chevron svg {
transform: rotate(0deg);
}
}

&__chevron {
display: flex;
margin: 0;
}

&__toggle {
display: none;
&__toggle:checked ~ &__title &__chevron {
svg {
transform: rotate(0deg);
}
}

&__label {
Expand All @@ -258,13 +221,19 @@
}
}

&-page__toggle ~ &-section {
display: none;
}

&-page__toggle:checked ~ &-section {
display: block;
}
.dropdown-toggle {
display: flex;
justify-content: space-between;
width: 100%;
height: 36px;
margin-bottom: 10px;
margin-top: 10px;
padding: 10px 16px;
border: 1px solid $color-dove-gray;
border-radius: 4px;
Expand All @@ -284,4 +253,13 @@
display: none;
}
}
}
h4 {
margin-top: 0;
margin-bottom: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid $color-dove-gray;
font-family: $gdfont-demibold;
font-size: 21px;
line-height: 1.25;
}
}
1 change: 0 additions & 1 deletion layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
</header>
<div class="container-fluid td-outer">
<div class="td-main">
{{ partial "navbar-breadcrumb.html" . }}
<div class="row flex-xl-nowrap">
<div class="col-12 col-lg-4 col-xl-3 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
Expand Down
5 changes: 2 additions & 3 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{{/* (C) 2023 GoodData Corporation */}}
<button type="button" id="gd-docs-menu__mobile-trigger" class="gd-docs-menu__mobile-btn" aria-expanded="false" aria-controls="gd-docs-menu" aria-label="Toggle navigation menu">
<span class="gd-docs-menu__mobile-icon" aria-hidden="true"></span>
</button>
<input type="checkbox" id="gd-docs-menu__mobile-trigger" class="gd-docs-menu__mobile-trigger" />
<label for="gd-docs-menu__mobile-trigger" class="gd-docs-menu__mobile-icon"></label>
<div class="gd-docs-menu__mobile-bg"></div>
<nav id="gd-docs-menu" class="gd-docs-menu init">
<div class="sidebar-skip-links">
Expand Down