From 876ff0f3ebe38cf154ac5457cd284ad581d71d7d Mon Sep 17 00:00:00 2001 From: Houssam Jelliti Date: Wed, 8 Mar 2023 00:38:58 +0100 Subject: [PATCH] feat(style.css): enhance single children menu bar items This commit targets items that act as single children items within a menu bar list, and enhances the styling so that they look and behave as items with a menu dropdown associated with them. It checks for the "aria-haspopup" attribute set to false and applies the styles. As I read the code, I found that some CSS rules clash with other rules if I use color variables for states like hover and focus, or if I try to look for a common styles ruleset and I add a selector for it. I believe what I added is not a good practice and does not follow a pattern because the code base became complicated to debug. In this case, I decided to inherit some styles and apply them to my selectors as I think it's a safe approach. Fixes #26 --- docs/index.html.ejs | 3 +++ style.css | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/docs/index.html.ejs b/docs/index.html.ejs index 0e85264..271aefd 100644 --- a/docs/index.html.ejs +++ b/docs/index.html.ejs @@ -197,11 +197,14 @@

A menu bar consists of menu elements that name menu items and they typically have a dropdown menu associated with them.

+

In case of a menu item as a single children or plain text with no menu dropdown associated with it, use aria-haspopup="false" attribute.

To create a menu bar we will use the .menu-bar class.

<%- example(`