From 6166afeec6589951efc7ecc6283d8810c2a957e1 Mon Sep 17 00:00:00 2001 From: Eliseu Amaro Date: Tue, 17 Aug 2021 21:43:34 +0100 Subject: [PATCH] [TWIG][CSS] Left and right panels accessibility improvements. Tabindex is now properly set up. When panels have the attribute open but aren't focused (keyboard navigation out of panel, into main content) they aren't displayed anymore. --- public/assets/css/base.css | 25 ++++++++++------------- templates/base.html.twig | 6 +++--- templates/network/public.html.twig | 2 +- templates/note/view.html.twig | 3 ++- templates/sidepanel/left/left.html.twig | 2 +- templates/sidepanel/right/right.html.twig | 2 +- 6 files changed, 19 insertions(+), 21 deletions(-) diff --git a/public/assets/css/base.css b/public/assets/css/base.css index eb78e26fb9..7da98bed41 100644 --- a/public/assets/css/base.css +++ b/public/assets/css/base.css @@ -96,6 +96,9 @@ left: var(--unit-size); font-size: var(--small-size); } +#header:above-level.panel[open] ~ * { + display: none; +} .icon { fill: var(--white); @@ -261,6 +264,7 @@ .icon-left, .icon-right { display: flex; + width: 100%; } /* by default they are hidden */ @@ -268,21 +272,15 @@ display: none; } - .panel[open] { - width: 100%; - font-size: var(--main-size); - } - - .panel[open] { - all: unset; - display: flex; - flex-direction: column; - } - - .panel aside { + .panel:not(:focus-within or :not[open]) aside { display: none; } - + .panel[open]:focus-within aside, + .panel[open] { + display: flex; + flex-direction: column; + font-size: var(--main-size); + } .panel[open] aside { padding: var(--unit-size); box-sizing: border-box; @@ -296,7 +294,6 @@ background-size: 100% 100%; min-height: 100%; - display: block !important; } .panel[open] aside .footer { diff --git a/templates/base.html.twig b/templates/base.html.twig index c518519a8c..2ede828581 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -32,19 +32,19 @@ {% block header %}