From 9e3ed36f346e89363f7cedde0c87b92c0f4d98d1 Mon Sep 17 00:00:00 2001 From: ximekilgsa Date: Thu, 22 Aug 2024 14:57:53 -0400 Subject: [PATCH 1/5] Add plus and minus svgs --- _img/minus.svg | 1 + _img/plus.svg | 1 + 2 files changed, 2 insertions(+) create mode 100644 _img/minus.svg create mode 100644 _img/plus.svg diff --git a/_img/minus.svg b/_img/minus.svg new file mode 100644 index 00000000..fe94d574 --- /dev/null +++ b/_img/minus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_img/plus.svg b/_img/plus.svg new file mode 100644 index 00000000..3399ab48 --- /dev/null +++ b/_img/plus.svg @@ -0,0 +1 @@ + \ No newline at end of file From e86adae01f47bea570012468e3368b999619b080 Mon Sep 17 00:00:00 2001 From: ximekilgsa Date: Thu, 22 Aug 2024 15:04:42 -0400 Subject: [PATCH 2/5] On-page submenu styles --- styles/tts-custom-styles.scss | 97 +++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/styles/tts-custom-styles.scss b/styles/tts-custom-styles.scss index a7a28ce9..09107029 100644 --- a/styles/tts-custom-styles.scss +++ b/styles/tts-custom-styles.scss @@ -109,3 +109,100 @@ h5 { .usa-prose .usa-card:last-child { margin-bottom: 1rem; } + +.usa-subnav-mobile-toggle { + display: none; +} + +/* Page sidenav */ +@media only screen and ( max-width: 1024px ) { + .usa-layout-docs main.display-flex { + flex-wrap: wrap; + } + + .usa-layout-docs__main { + flex: 0 0 100%; + padding: 3rem; + order: 2; + } + + .usa-layout-docs__sidenav { + flex: 0 0 100%; + order: 1; + padding: 0rem 3rem; + + nav { + opacity: 0; + height: 0; + transition: all .3s ease-in-out; + } + + .usa-subnav-mobile-toggle { + display: flex; + border: none; + background: transparent; + font-weight: 600; + font-size: 1.25rem; + gap: 8px; + align-items: center; + line-height: 1; + + &::after { + content: url('../_img/plus.svg'); + display: block; + height: 16px; + width: 16px; + } + + &.open-subnav { + margin-bottom: .75rem; + + &::after { + content: url('../_img/minus.svg'); + } + + + nav { + opacity: 1; + height: auto; + transition: all .3s ease-in-out; + } + } + } + + .toggle-submenu { + position: relative; + + &::before { + content: url('../_img/plus.svg'); + position: absolute; + width: 16px; + height: 16px; + top: 9px; + right: 16px; + } + + a { + width: fit-content; + } + + ul { + opacity: 0; + height: 0; + transition: all .3s ease-in-out; + } + + &.open-subnav { + &::before { + content: url('../_img/minus.svg'); + } + + ul { + opacity: 1; + height: auto; + transition: all .3s ease-in-out; + } + } + } + + } +} From 9ef59477122413f4a565efcaa66146eeec32e6ca Mon Sep 17 00:00:00 2001 From: ximekilgsa Date: Thu, 22 Aug 2024 15:07:06 -0400 Subject: [PATCH 3/5] Add JS for on-page submenu toggle --- _includes/scripts.html | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/_includes/scripts.html b/_includes/scripts.html index f5a3e103..130e8242 100644 --- a/_includes/scripts.html +++ b/_includes/scripts.html @@ -34,3 +34,31 @@ {% endif %} {% endif %} + + + From ea185381644ff5d5bea662276026a46f65dbdc15 Mon Sep 17 00:00:00 2001 From: ximekilgsa Date: Thu, 22 Aug 2024 15:14:24 -0400 Subject: [PATCH 4/5] Add toggle button to sidenav html --- _includes/sidenav.html | 1 + 1 file changed, 1 insertion(+) diff --git a/_includes/sidenav.html b/_includes/sidenav.html index 310dfd89..ad588a4e 100644 --- a/_includes/sidenav.html +++ b/_includes/sidenav.html @@ -1,3 +1,4 @@ +