Problem/Motivation

Followup from #3153260: Standardize Olivero's focus states across all non-form controls

Olivero is using an outline-offset to indicate focus states around hyperlinks. In certain cases where a link is directly adjacent to a container that has the overflow property set, part of the focus state can get cut off.

This includes

  • Mobile - Primary menu submenus
  • Mobile - Breadcrumbs

Before

Steps to reproduce

1. In the Drupal website use Olivero as default theme
2. Add the breadcrumb block to the page or content type nodes.
3. Visit the pages via the Mobile/Tabs
4. Click the breadcrumb link and observe the outline highlight.

Proposed resolution

Update the CSS logic on core/themes/olivero/css/components/breadcrumb.css

Remaining tasks

Nil

User interface changes

Before

before

After

after

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

CommentFileSizeAuthor
#46 After patch Ipad.png29.01 KBsagarmohite0031
#46 Before patch Ipad.png42.55 KBsagarmohite0031
#46 After patch Mobile.png30.39 KBsagarmohite0031
#46 Before patch Mobile.png24.22 KBsagarmohite0031
#33 olivero-focus-3200584.patch879 bytessheetal.pathak
#33 After-oliver-focus-fix.png36.78 KBsheetal.pathak
#33 Before-olivero-focus.png36.43 KBsheetal.pathak
#27 After--patch--pic--3200584.png23.82 KBvikashsoni
#27 Before--patch--pic--3200584.png109.2 KBvikashsoni
#25 After Patch 3200584 Child.png531.01 KBchetanbharambe
#25 After Patch 3200584 Parent.png545.51 KBchetanbharambe
#25 After Patch 3200584.png404.02 KBchetanbharambe
#25 Before Patch 3200584.png670.15 KBchetanbharambe
#24 3200584.24.patch7.9 KBsakthivel m
#24 After-patch.png396.8 KBsakthivel m
#24 Before-patch.png503.34 KBsakthivel m
#20 3200584-20.patch7.9 KBkiran.kadam911
#18 3200584-18.mp410.84 MBkiran.kadam911
#18 3200584-18.patch7.95 KBkiran.kadam911
#17 3200584-17.mp411.9 MBkiran.kadam911
#14 olivero-mobile-menu-overflow.mp4231.48 KBmherchel
#11 Screen Shot 2021-03-24 at 9.05.31 AM.png314.13 KBjenniferhoude
#8 3200584_18_after.png256.95 KBhinal05
#8 3200584_18_before.png256.95 KBhinal05
#8 3200584_18_after1.png260.09 KBhinal05
#8 3200584_18_before1.png260.09 KBhinal05
#6 3200584-6.patch1.82 KBgauravvvv
#2 Screenshot 2021-03-09 at 13.49.13.png16.04 KBgauravvvv
#2 Screenshot 2021-03-09 at 13.49.43.png16.08 KBgauravvvv
#2 Screenshot 2021-03-09 at 13.44.16.png15.69 KBgauravvvv
#2 Screenshot 2021-03-09 at 13.36.23.png17.87 KBgauravvvv
#2 focus-3200584-2.patch1.91 KBgauravvvv

Issue fork drupal-3200584

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mherchel created an issue. See original summary.

gauravvvv’s picture

I have attached a patch for the issue and added after-patch screenshots for reference. Please review.

gauravvvv’s picture

Status: Active » Needs review
gauravvvv’s picture

imalabya’s picture

Status: Needs review » Needs work
+++ b/core/themes/olivero/css/components/navigation/nav-primary.pcss.css
@@ -147,7 +147,7 @@
-  overflow: hidden;
+  overflow: visible;

The overflow property has the default value of visible, so we can remove the property unless we are overriding the value.

gauravvvv’s picture

StatusFileSize
new1.82 KB

Updated patch as per comment #5.

gauravvvv’s picture

Status: Needs work » Needs review
hinal05’s picture

StatusFileSize
new260.09 KB
new260.09 KB
new256.95 KB
new256.95 KB

Applied patch #6. Got same issue for Home link in breadcrumb. After applied patch, there is no change in breadcrumb. Please check the screenshots.

jenniferaube made their first commit to this issue’s fork.

jenniferhoude’s picture

StatusFileSize
new314.13 KB

Tested Patch #6, Including screenshot to show the patch is working.

jenniferhoude’s picture

Status: Needs review » Reviewed & tested by the community
mherchel’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new231.48 KB

Thanks for the work on this!

+++ b/core/themes/olivero/css/components/breadcrumb.pcss.css
@@ -52,7 +52,6 @@
-  overflow-x: auto;

Removing this will cause long breadcrumbs to overflow (potentially off the page) instead of creating a horizontal scrolling region. When you test this, use browser developer tools to add many items into your breadcrumbs to see how they interact.

+++ b/core/themes/olivero/css/components/navigation/nav-primary.css
@@ -284,7 +284,6 @@
-  overflow: hidden;

Removing this causes the submenu closing transition to be weird, where it will remove the menu, but the links take a bit longer to fade out. Attaching a video.

When you're removing code, also try to think "What was the original purpose of this? Why was it included?" and then make sure you account for that case.

jenniferhoude’s picture

Assigned: Unassigned » jenniferhoude

kiran.kadam911’s picture

Assigned: jenniferhoude » Unassigned
StatusFileSize
new11.9 MB

@mherchel Please check below findings related to this issues,

+++ b/core/themes/olivero/css/components/breadcrumb.pcss.css
@@ -52,7 +52,6 @@
-  overflow-x: auto;

We can remove this overflow because its outer wrapper(.breadcrumb__content) also having overflow auto so using that breadcrumb will work same as expected.

+++ b/core/themes/olivero/css/components/navigation/nav-primary.css
@@ -284,7 +284,6 @@
  overflow: hidden;

Instead of removing overflow here we can add 3px padding(top & bottom) to active child(.primary-nav__menu--level-2.is-active-menu-parent) which will resolve child menu focus issue and even transition will remain as it is.

Here I am attaching a screen video please have a look. So that we can go ahead or think of another approach.

Thanks!

kiran.kadam911’s picture

StatusFileSize
new7.95 KB
new10.84 MB

@mherchel Here I am providing another solution to this issue.

Kindly review the attached patch and feel free to add your opinion on this.

Here I am attaching a screen video please have a look. So that we can go ahead or think of another approach.

Note: There are some diff changes of the semi-colon(;) removal in nav-primary.css which is an auto process for the single property we can ignore that.

Thanks!

kiran.kadam911’s picture

Status: Needs work » Needs review
kiran.kadam911’s picture

StatusFileSize
new7.9 KB

Since custom commands failed, here providing an updated patch after fixing drupalci issues. Rest other things are fine and as per #18 description.

Kindly review the attached updated patch.

Thanks!

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mherchel’s picture

Status: Needs review » Needs work
+++ b/core/themes/olivero/css/components/breadcrumb.css
@@ -131,7 +131,6 @@
-  overflow-x: auto;

We have this added so the breadcrumbs container will horizontally scroll in the event there are more breadcrumb items than the space can accommodate. We need to keep this.

mherchel’s picture

Scratch my last comment. The parent selector has overflow: auto, so we do not need the overflow-x property.

sakthivel m’s picture

Status: Needs work » Needs review
StatusFileSize
new503.34 KB
new396.8 KB
new7.9 KB

Just Re roll the patch 9.3.x

As per the @mherchel last comment. so we have keep it overflow: auto and removed overflow-x property.

patch #20 working as expected.

@kiran.kadam911 Thanks for the patch.

chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new670.15 KB
new404.02 KB
new545.51 KB
new531.01 KB

Verified and tested patches #20 and #24.
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: admin/config/development/performance
# See Breadcrumbs
# Check the focus
# User should see focus state outline should be accurate.

Expected Results:
# User should see focus state outline should be accurate on a element.
# User should see The parent selector has overflow: auto
# User should not see overflow-x property

Actual Results:
# User is able to see overflow: auto in Child selector
# User is able to see focus state outline is getting cut off.

As per the @mherchel last comment. so we have kept it overflow: auto and removed the overflow-x property.

Can be a move to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

@lauriii and I have discussed this issue. It would be great if the issue summary was updated to contain steps to reproduce the issue and define the entire scope. There seems to be overflow issues for both primary menu and breadcrumbs - can the issue summary have steps for both situations.

Also the latest changes from #18 onwards significantly changed the solution - it would be great to have a detailed explanation of why we moved from a change that only changes overflows to a more complex solution.

+++ b/core/themes/olivero/css/components/navigation/nav-primary.css
@@ -152,19 +184,19 @@
-  padding-left: 0;
+  padding-left: 0
...
-  padding-right: 0;
+  padding-right: 0
...
-  padding-right: 0;
+  padding-right: 0
...
-  padding-left: 0;
+  padding-left: 0

All these removals of semi-colons is very odd. Seems to be a bug in the build system. I think we should land #3246141: Update JavaScript dependencies prior to 9.3.0 first and see if it fixes it.

vikashsoni’s picture

StatusFileSize
new109.2 KB
new23.82 KB

Applied #20 and #24 patch working fine giving expected result
for ref sharing screenshot ....
Thanks for the patch

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

sheetal.pathak’s picture

StatusFileSize
new36.43 KB
new36.78 KB
new879 bytes

Hi
I checked both issues in 11.x-dev.

Mobile - Primary menu submenus is fixed in checked version
Mobile - Breadcrumbs - Issues still exists.

I have created patch for it. Adding before and after screenshots for reference.

I have created Patch file as I am facing issue in creating MR (new branch).

arunkumark made their first commit to this issue’s fork.

preeti.chawla made their first commit to this issue’s fork.

preeti.chawla’s picture

Hi,

I checked both issues on the 11.x-dev version. The breadcrumb display on mobile was not working correctly, but it’s functioning well after applying the patch. However, I couldn’t reproduce the primary issue; it works fine without any patch. So I’ve created a merge request for patch #33.

arunkumark’s picture

Status: Needs work » Needs review

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs issue summary update

Have not reviewed, issue summary is incomplete.

arunkumark’s picture

Issue summary: View changes
arunkumark’s picture

Issue summary: View changes
arunkumark’s picture

Status: Needs work » Needs review

Updated the issue summary. Moving to NR.

sagarmohite0031’s picture

StatusFileSize
new24.22 KB
new30.39 KB
new42.55 KB
new29.01 KB

Hello,
I have tested and verified this issue on Drupal 11.x version with Oliviero.
MR applied successfully.

Testing steps:
Step1 : Install Drupal use Olivero as default theme
Step2 : Add the breadcrumb block to the page or content type nodes.
Step3 : Visit the pages via the Mobile/Tabs
Step4 : Click the breadcrumb link and observe the outline highlight.

Attached the Before and After Screenshot for Mobile/Tab.
Hence can be move to RTBC
RTBC+1

saurav-drupal-dev’s picture

Reviewed the MR RTBC+1

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs issue summary update

Based on the review from #46 updating issue summary with before/after screenshots.

Saving credit for the review in #46 also.

nod_’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for sorting out the credits!

left a question

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

quietone’s picture

Title: Olivero's focus state outline can get cut off certain situations » focus state outline can get cut off certain situations
Status: Needs work » Postponed

The Olivero theme was approved for removal in #3590816: [policy, no patch] Deprecate Olivero and move to contrib.

This is Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.

The deprecation work is in #3595082: [meta] Tasks to deprecate the Olivero theme and the removal work in #3595085: [meta] Tasks to remove the Olivero theme.