Styling of front theme affects styling of navigation buttons

Created on 11 November 2024, about 1 month ago

Problem/Motivation

When using the new navigation bar, everything looks ok in the admin theme (claro or gin for example), but when the navigation bar is viewed with the front/public theme, and these theme has very simple styles for button, then the navigation links and icons start looking weird and out of place.

Steps to reproduce

Create a super basic front theme that has a different display for the button element, for example:

button {
  display: inline-block;
}

Then, when you view the navigation bar, it looks like this (username removed from the screenshot):

But, it should look like this:

Proposed resolution

In this thread https://drupal.slack.com/archives/C7AB68LJV/p1731068262842939, we talked about some options.
It seems that the most sensible for this case was:

Mike Herchel: IMO the solution for this is either web components or a proper CSS reset like we do within the off-canvas tray

Remaining tasks

Implement a CSS reset for navigation elements that can be shown in the front-end.

User interface changes

It will look consistent when switching between the front theme and the admin theme.

Introduced terminology

-

API changes

-

Data model changes

-

Release notes snippet

-

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

navigation.module

Created by

🇪🇸Spain fjgarlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024