From 03a075e2556d0f14ad5863e7f2da7dfd48cc6f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 15 Jul 2025 20:21:31 -0400 Subject: [PATCH] Format source code (no other changes) --- .../custom/geofresco/src/global/_layout.scss | 184 +++++++++--------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/web/themes/custom/geofresco/src/global/_layout.scss b/web/themes/custom/geofresco/src/global/_layout.scss index f2a15da..7d2885e 100644 --- a/web/themes/custom/geofresco/src/global/_layout.scss +++ b/web/themes/custom/geofresco/src/global/_layout.scss @@ -43,11 +43,11 @@ // Prevent a slight horizontal scroll. -/* On content listing pages (e.g. card view mode). */ +// On content listing pages (e.g. card view mode). .background-replacement-for-no-image { height: 10rem; } -/* On full content pages. */ +// On full content pages. .featured-image .background-replacement-for-no-image { height: 12rem; @include mixins.from($desktop) { @@ -58,114 +58,114 @@ } } -/* Yes i know i should just give author bios their own class */ +// Yes i know i should just give author bios their own class .node--type-people.node--view-mode-teaser { margin-bottom: 1rem; } // Main navigation, goes to code in page.html.twig @include mixins.mobile { -// Code adapted from https://unused-css.com/blog/css-only-hamburger-menu/ -.hamburger-container { - transition: transform 0.5s ease; -} - -// We don't need the checkbox to be visible, but we can't set it to display: none because this will break keyboard navigation. Instead set the opacity to 0 and the position to absolute so it doesn't push the rest of the content down. -.hamburger-container .checkbox { - opacity: 0; - position: absolute; -} - -// Show an outline when the hamburger is selected using the keyboard. Older browsers don't support :focus-visible, so we will just use :focus here. -.hamburger-container .checkbox:focus ~ .hamburger { - outline: 2px solid yellow; // Default for browsers that do not support outline: auto - outline: auto; - outline-offset: 4px; -} - -// For newer browsers that do support :focus-visible, hide the outline when the checkbox isn't selected with the keyboard. -@supports selector(:focus-visible) { - .hamburger-container .checkbox:not(:focus-visible) ~ .hamburger { - outline: none; + // Code adapted from https://unused-css.com/blog/css-only-hamburger-menu/ + .hamburger-container { + transition: transform 0.5s ease; } -} -/* Hide any focusable elements in the drawer by default to aid keyboard navigation. We use visibility so it makes the elements unfocusable, but doesn't affect the layout. We can also add a "transition" to visibility, which will make it show instantly when we open the drawer, but take half a second to hide it when we close the drawer. */ -.hamburger-container .drawer a { - visibility: hidden; - transition: visibility 0.5s linear; -} + // We don't need the checkbox to be visible, but we can't set it to display: none because this will break keyboard navigation. Instead set the opacity to 0 and the position to absolute so it doesn't push the rest of the content down. + .hamburger-container .checkbox { + opacity: 0; + position: absolute; + } -/* Make the focusable elements in the drawer visible when it is open. */ -.hamburger-container .checkbox:checked ~ .drawer a { - visibility: visible; -} + // Show an outline when the hamburger is selected using the keyboard. Older browsers don't support :focus-visible, so we will just use :focus here. + .hamburger-container .checkbox:focus ~ .hamburger { + outline: 2px solid yellow; // Default for browsers that do not support outline: auto + outline: auto; + outline-offset: 4px; + } -.hamburger-container .checkbox:checked ~ .drawer { - transform: translateX(0%); -} + // For newer browsers that do support :focus-visible, hide the outline when the checkbox isn't selected with the keyboard. + @supports selector(:focus-visible) { + .hamburger-container .checkbox:not(:focus-visible) ~ .hamburger { + outline: none; + } + } -.hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(1) { - transform: translateY(12px) rotate(45deg); -} + // Hide any focusable elements in the drawer by default to aid keyboard navigation. We use visibility so it makes the elements unfocusable, but doesn't affect the layout. We can also add a "transition" to visibility, which will make it show instantly when we open the drawer, but take half a second to hide it when we close the drawer. + .hamburger-container .drawer a { + visibility: hidden; + transition: visibility 0.5s linear; + } -.hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(2) { - opacity: 0; -} + // Make the focusable elements in the drawer visible when it is open. + .hamburger-container .checkbox:checked ~ .drawer a { + visibility: visible; + } -.hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(3) { - transform: translateY(-12px) rotate(-45deg); -} + .hamburger-container .checkbox:checked ~ .drawer { + transform: translateX(0%); + } -.hamburger { - cursor: pointer; - display: block; - position: relative; - margin-left: auto; - margin-right: 0; - padding: 1.5rem 2rem 1rem 1rem; - width: 5rem; - height: 5rem; - transition: transform 0.3s ease; - z-index: 1; -} + .hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(1) { + transform: translateY(12px) rotate(45deg); + } -.hamburger .slice { - display: block; - width: 100%; - height: 0.1875rem; - background-color: $green; - transition: all 0.3s ease; -} + .hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(2) { + opacity: 0; + } -.hamburger .slice:not(:first-child) { - margin-top: 0.5rem; -} + .hamburger-container .checkbox:checked ~ .hamburger .slice:nth-child(3) { + transform: translateY(-12px) rotate(-45deg); + } -.drawer { - position: absolute; - right: 0; - top: 5rem; - height: fit-content; - width: max-content; - max-width: 100%; - padding: 1.5rem; - background: local.$offwhite; - transform: translateX(-100%); - transition: transform 0.4s ease; - z-index: 100; -} + .hamburger { + cursor: pointer; + display: block; + position: relative; + margin-left: auto; + margin-right: 0; + padding: 1.5rem 2rem 1rem 1rem; + width: 5rem; + height: 5rem; + transition: transform 0.3s ease; + z-index: 1; + } -.drawer .nav-list { - padding: 0; - list-style: none; - // margin-top: 30px; - // margin-left: 20px; -} + .hamburger .slice { + display: block; + width: 100%; + height: 0.1875rem; + background-color: $green; + transition: all 0.3s ease; + } -.drawer .nav-list .nav-list-item { - // padding-bottom: 10px; -} + .hamburger .slice:not(:first-child) { + margin-top: 0.5rem; + } + + .drawer { + position: absolute; + right: 0; + top: 5rem; + height: fit-content; + width: max-content; + max-width: 100%; + padding: 1.5rem; + background: local.$offwhite; + transform: translateX(-100%); + transition: transform 0.4s ease; + z-index: 100; + } + + .drawer .nav-list { + padding: 0; + list-style: none; + // margin-top: 30px; + // margin-left: 20px; + } + + .drawer .nav-list .nav-list-item { + // padding-bottom: 10px; + } } @include mixins.tablet { @@ -174,7 +174,7 @@ } } -/* Make the drawer full-width on mobile */ +// Make the drawer full-width on mobile @media screen and (max-width: local.$mini) { .drawer { width: 100%;