From 060d37c040a6650bd580ab30f37660a8c54c35fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rn=20A=CC=8Ane?= Date: Tue, 13 Feb 2018 18:44:36 +0100 Subject: [PATCH] Better styling of the user menu --- inc/navbar.php | 19 +++++++------------ www/css/style.css | 8 ++++++++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/inc/navbar.php b/inc/navbar.php index d902756..b1a1f1e 100644 --- a/inc/navbar.php +++ b/inc/navbar.php @@ -31,14 +31,9 @@ function loginBar($sp = null, $pdo = null) { require_once(__DIR__ . '/../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php'); $as = new SimpleSAML_Auth_Simple($sp); - $svgWhite = ' - - - -'; - $svgBlue = ' - - + $svg = ' + + '; @@ -51,17 +46,17 @@ function loginBar($sp = null, $pdo = null) { } else { $isAdmin = false; } - $result .= "\t${svgWhite}" . htmlspecialchars($uname) . "\n"; - $result .= "\n\t\n"; + + $result .= "\t${svg}" . htmlspecialchars($uname) . "\n"; } else { - $result .= "\tgetLoginURL()) . "\">${svgWhite}Logg inn\n"; + $result .= "\tgetLoginURL()) . "\">${svg}Logg inn\n"; } $result .= "\n\t☰ MENU\n"; diff --git a/www/css/style.css b/www/css/style.css index 89813ce..04c6c6d 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -68,6 +68,7 @@ nav a { display: inline-block; margin: auto; color: white; + fill: white; /* SVG icon */ text-decoration: none; margin: 0 .75em; } @@ -98,6 +99,13 @@ nav #usermenu li, nav #usermenu li a { nav #usermenu:target { display: block; } +/* Style #login when #usermenu is targeted */ +/* Requires #login to appear after #usermenu, directly under nav */ +nav #usermenu:target ~ #login { + color: #024; + fill: #024; /* SVG icon */ + background: white; +} @media(max-width: 800px){ nav #menu, nav #menu li.active, nav #menu_toggle, nav #login {