Problem/Motivation

1. When there are too many items in the primary tabs, the tabs are too wide and overflow the screen boundaries
2. Bottom border of active tab is partially greyed

Steps to replicate:

  1. Download / enable Webform module
  2. Go to /webform/contact page
  3. Or you can set Olivero as an administration theme and go to /admin/structure/webform

Screenshot of the 1st issue:

Screenshot of the 2nd issue:

Proposed resolution

1. About too wide tabs - good proposed resolution here https://www.drupal.org/project/olivero/issues/3127480#comment-13555092
2. About bottom border - it's up to you :)

Comments

shaal created an issue. See original summary.

kostyashupenko’s picture

Issue tags: +Needs design

I guess some design proposals expected here, since figma has only case with 3 tabs.
Also would be nice to review mobile tabs as well

shaal’s picture

Issue summary: View changes
Issue tags: -Needs design
StatusFileSize
new21.04 KB

I don't think a new design is needed here.

On mobile there is no problem. The primary tabs are displayed vertically:

Maybe in a similar way to how the main-menu / mobile-menu is dynamically changing, according to the actual width of all menu items.

So when there's not enough space to display all tabs in primary tabs horizontally, they should be displayed vertically like in mobile.

mherchel’s picture

Yeah, we probably use something like intersection observer or resize observer to work with it.

But for it to work without JS (which would be nice), we could also just let them wrap.

kostyashupenko’s picture

Re #3:

So when there's not enough space to display all tabs in primary tabs horizontally, they should be displayed vertically like in mobile.

Honestly i don't think it's good idea at all. We may have a case sometimes when we don't have enough space on large screens. Check screenshot:
Tabs

So if we will switch it on dropdown, where tabs will be displayed like 1 tab per 1 row, it will be too wide tabs. Also i believe we have to evade js solution in all places where possible.

Re #4:

we could also just let them wrap

Well it doesn't look too good right now if to let them wrap. There is a mess with side borders, check screenshot:
Tabs

So we need design proposals here as i said, maybe we can make these tabs less size than now, or let them wrap, but add top/bottom borders, or smth.

mherchel’s picture

StatusFileSize
new55.86 KB
new102.3 KB

It's never going to look good when it wraps, but it can look better. Instead of adding a background color on the parent element, we could add it on the list items themselves, and give it a slight bottom margin. Thoughts?

kostyashupenko’s picture

Title: Primary tabs are too wide » Primary tabs are too wide and blue border looks partially greyed
Issue summary: View changes
StatusFileSize
new7.01 KB
kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
Status: Active » Needs work

@mherchel i really like your proposed solution

Gonna manage this task

kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
Status: Needs work » Needs review
StatusFileSize
new9.79 KB
dunebl’s picture

I would add the following:
Maybe we can differentiate a little bit more the primary and secondary tabs design. This is because, like it is, a lambda/new user will have some pain to understand the fact that primary tabs are structurally more important (like <h1> and <h2>)

Some ideas:
-Primary: Uppercase vs Secondary: Sentence case (or lowercase) [and/or font size smaller]
-Primary: background vs Secondary:no background
-Primary: vertical border vs Secondary: no border

We can also decrease some padding/margin if necessary

kostyashupenko’s picture

I would suggest the following:

Primary tabs

Secondary tabs

dunebl’s picture

This is really better! +1

mherchel’s picture

StatusFileSize
new61.81 KB

The patch in #9 looks good, but doesn't match the designs in #11 (#11 has a white background). Is there still work going on? I think we should move the secondary tabs task to a followup issue.

kostyashupenko’s picture

Assigned: Unassigned » kostyashupenko
Status: Needs review » Needs work
kostyashupenko’s picture

Assigned: kostyashupenko » Unassigned
Status: Needs work » Needs review
StatusFileSize
new11.56 KB
new5.6 KB
new35.53 KB
new27.12 KB

Ready for review.

Mobile tabs:
Mobile tabs

Desktop:
Desktop tabs

mherchel’s picture

Status: Needs review » Fixed

Looking good! Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.