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

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

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

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

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

&__mobile-trigger {
display: none;
}

&__mobile-icon {
&__mobile-btn {
position: fixed;
top: 80px;
top: $header-first-nav-height-desktop;
left: 10px;
z-index: 34;
display: flex;
justify-content: center;
align-items: center;
width: 55px;
height: $header-second-nav-height;
left: 10px;
z-index: 34;
padding: 0;
background: transparent;
border: none;
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;
}
}

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

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

.gd-docs-menu__mobile-icon::after {
content: "";
display: block;
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 @@ -99,21 +121,10 @@
display: none;
}
}
&__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;
}
&__mobile-btn[aria-expanded="true"] ~ &,
&__mobile-btn[aria-expanded="true"] ~ &__mobile-bg {
left: 0;
}

& > &-section {
Expand All @@ -139,6 +150,14 @@
}
}

&-section-wrapper {
display: none;

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

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

&__toggle {
display: none;
}

&__chevron {
&__toggle-btn {
display: flex;
align-items: center;
justify-content: center;
margin: 4px 0 0;
padding: 4px;
background: transparent;
border: none;
cursor: pointer;

svg {
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 {
transform: rotate(180deg);
}
}

&__toggle:checked ~ &__title &__chevron {
svg {

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

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

&__toggle {
display: none;
}

&__label {
display: block;
flex: 0 0 auto;
Expand All @@ -221,19 +258,13 @@
}
}

&-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 @@ -253,13 +284,4 @@
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;
}
}
}
18 changes: 10 additions & 8 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<head>
{{ partial "head.html" . }}
{{ partial "meta-version.html" . }}
{{ if .Params.externalLink }}
<meta http-equiv="refresh" content="0;url={{ .Params.externalLink }}" />
{{ end }}
</head>
<body class="td-{{ .Kind }}{{ if .Page.Params.edition }} doc{{ .Page.Params.edition }}{{ end }}{{ if .Page.Params.type }} {{ .Page.Params.type }}{{ end }}" id="top">
{{ partial "gtm-body.html" }}
Expand All @@ -15,14 +18,15 @@
</header>
<div class="container-fluid td-outer">
<div class="td-main">
{{ partial "navbar-breadcrumb.html" . }}
<div class="row flex-xl-nowrap">
<div class="col-xl-2 col td-sidebar d-print-none">
<div class="col-12 col-lg-4 col-xl-3 td-sidebar d-print-none">
{{ partial "sidebar.html" . }}
</div>
<div class="d-none d-xl-block col-xl-1 td-toc d-print-none">
<div class="d-none d-xl-block col-xl-2 td-toc d-print-none">
{{ partial "toc.html" . }}
</div>
<main class="
col-12 col-xl-8
" role="main" id="main-content">
<main class="col-12 col-lg-8 col-xl-7 pl-lg-5 ps-lg-5" role="main" id="main-content">
{{ partial "version-banner.html" . }}
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }}
{{ if .Draft }}
Expand All @@ -39,8 +43,6 @@ <h1>DRAFT</h1>
</div>
{{ partial "custom-scripts.html" . }}
{{ partial "scripts.html" . }}
{{ if ne .Page.Params.type "search-results" }}
{{ partial "search.html" . }}
{{ end }}
{{ partial "search.html" . }}
</body>
</html>
1 change: 1 addition & 0 deletions layouts/docs/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</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: 3 additions & 2 deletions layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{/* (C) 2023 GoodData Corporation */}}
<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>
<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>
<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