More a11y: dialogs on book page
[wolnelektury.git] / src / wolnelektury / static / 2022 / styles / layout / _navigation.scss
index a47875b..ece84d5 100644 (file)
@@ -3,6 +3,8 @@ body {
 }
 
 .l-navigation {
+  --focus-ring: #fff;
+    
   max-width: 100%;
   margin: 0 auto;
   background-color: #083F4D;
@@ -27,30 +29,6 @@ body {
     align-items: center;
     justify-content: space-between;
   }
-
-  &.is-open {
-    position: fixed;
-    top: 0; left: 0;
-    width: 100%;
-    z-index: $master-layer;
-
-    .l-navigation__logo {
-        width: unset;
-        overflow: unset;
-    }
-
-    .l-navigation__menu {
-      opacity: 1;
-      pointer-events: all;
-    }
-
-    .c-lang {
-      opacity: 1;
-      .c-lang__button {
-        pointer-events: all;
-      }
-    }
-  }
 }
 
 .l-navigation__logo {
@@ -87,20 +65,9 @@ body {
   background: 0;
   padding: 0;
   margin: 0;
-  outline: 0;
   position: relative;
 }
 
-.is-open {
-    .l-navigation__logo {
-        z-index: $master-layer + 1;
-    }
-    .l-navigation__button {
-        z-index: $master-layer + 1;
-    }
-}
-
-
 .l-naviagion__search {
     width: 60%;
     max-width: 580px;
@@ -123,7 +90,6 @@ body {
     border-radius: 52px;
     width: 100%;
     max-width: 580px;
-    outline: 0;
 
     @include rwd($break-menu) {
         font-size: 18px;
@@ -138,9 +104,10 @@ body {
     position: relative;
     height: 44px;
 
-  .icon-liked {
+  .user-liked {
     color: #85C7CC;
     font-size: 30px;
+    line-height: 30px;
     margin-right: 25px;
   }
 
@@ -174,6 +141,9 @@ body {
 
     .user {
         margin-right: 25px;
+        background: none;
+        border: none;
+        padding: 0;
     }
 
 }
@@ -226,24 +196,51 @@ body {
 }
 
 .l-navigation__menu {
-  position: fixed;
-  top: 0; left: 0;
-  width: 100%; height: 100%;
-  background-color: #083F4D;
-  z-index: $master-layer;
-  padding-top: 50px;
-  opacity: 0;
-  pointer-events: none;
-  transition: opacity 350ms $ease-out;
-
-  @include rwd($break-menu) {
-      padding-top: 93px;
-  }
-  
-  .l-container {
-    display: flex;
+    margin: 0;
+    padding: 0;
+    border: 0;
+    max-width: none;
+    max-height: none;
+    width: 100%;
+    height: 100%;
     flex-direction: column;
-  }
+    background-color: #083F4D;
+    opacity: 0;
+    transition: opacity 350ms $ease-out;
+    // Gdy
+    // https://caniuse.com/wf-display-animation, https://caniuse.com/wf-overlay
+    //   display 350ms allow-discrete,
+    //   overlay 350ms allow-discrete;
+
+    &[open] {
+        display: flex;
+        opacity: 1;
+    }
+    &:not([open]) {
+        pointer-events: none;
+    }
+    // https://caniuse.com/wf-display-animation, https://caniuse.com/wf-overlay
+    &.is-closing {
+        opacity: 0;
+        pointer-events: none;
+    }
+  
+    .l-navigation__menu__top {
+        padding: 3px 0;
+        @include rwd($break-menu) {
+            padding: 12px 0;
+        }
+    }
+    .scrollable {
+        height: 100%;
+        overflow-y: auto;
+        padding-bottom: 30px;
+
+        .l-container {
+            display: flex;
+            flex-direction: column;
+        }
+    }
 
   .l-navigation__user-bar {
       width: 100%;
@@ -284,6 +281,18 @@ body {
   }
 }
 
+body:has(dialog[open]) {
+    overflow: hidden;
+}
+
+@starting-style {
+    .l-navigation__menu[open] {
+        opacity: 0;
+    }
+}
+@media (prefers-reduced-motion: reduce) {
+  .l-navigation__menu { transition: none; }
+}
 
 .l-navigation__menu__blocks {
     position: relative;
@@ -315,12 +324,8 @@ body {
       gap: 3%;
   }
 
-  ul {
-    margin: 0;
-    padding: 0;
-    list-style: none;
-    //max-width: 212px;
-    width: 45%;
+  .l-navigation__menu__group {
+      width: 45%;
 
     @include rwd($break-menu) {
       width: 100%;
@@ -328,6 +333,19 @@ body {
       margin-bottom: 20px;
     }
 
+    h2 {
+        margin: 16px 0 0 0;
+        color: #92BD39;
+        font-weight: $semibold;
+        @include font-size(21px);
+        line-height: 140%;
+        letter-spacing: -0.01em;
+    }
+
+    ul {
+        margin: 0;
+        padding: 0;
+        list-style: none;
     li {
       font-weight: $regular;
       font-size: 16px;
@@ -339,19 +357,17 @@ body {
           line-height: 115%;
       }
 
-      strong {
-        color: #92BD39;
-        font-weight: $semibold;
-        @include font-size(21px);
-        line-height: 140%;
-        letter-spacing: -0.01em;
-      }
-
       a {
         color: $color-white;
         &:hover {
           text-decoration: underline;
         }
+
+        em {
+            font-style: normal;
+            color: #FFA500;
+            font-weight: 600;
+        }
       }
 
       hr {
@@ -362,6 +378,7 @@ body {
         border: 0;
       }
     }
+    }
   }
 }