This issue was identified in the Olivero issue queue, but seems to have a wider impact than just that theme.

When logged in to a fresh Drupal 10 installation, a fine thin line appears below the footer. This has been identified as the aria-live region, as needed by the admin toolbar. The visually-hidden class does not appear to adequately hide this element.

screenshot of Olivero theme with thin white line below footer

CommentFileSizeAuthor
#78 Screenshot 2023-01-26 at 12.22.57 PM.png439.81 KBandy-blum
#77 Screenshot 2023-01-26 at 12.00.38 PM.png59.87 KBandy-blum
#77 Screenshot 2023-01-26 at 11.58.51 AM.png413.9 KBandy-blum
#77 Screenshot 2023-01-26 at 12.01.37 PM.png48.43 KBandy-blum
#77 Screenshot 2023-01-26 at 11.58.07 AM.png436.11 KBandy-blum
#76 interdiff_74-76.txt728 bytesShubham Sharma 77
#76 3196976-76.patch430 bytesShubham Sharma 77
#74 interdiff_71-74.txt428 bytesRatan Priya
#74 3196976-74.patch754 bytesRatan Priya
#71 3196976-71.patch759 bytesandy-blum
#70 beforepatch.jpg40.1 KBheni_deepak
#70 afterpatch.jpg77.73 KBheni_deepak
#68 After_Patch.png104.46 KBgaurav-mathur
#68 Before_Patch.png104.1 KBgaurav-mathur
#65 Screenshot 2022-11-14 at 3.10.37 PM.png309.52 KBpradipmodh13
#64 White-line-below-footer-3196976-61.patch470 bytesHarish1688
#63 After-patch-3196976.png745.65 KBHarish1688
#63 Before-patch-3196976.png757.17 KBHarish1688
#60 after patch.png22.6 KBsaman malik
#60 Before.png22.83 KBsaman malik
#60 3196976-55_0.patch772 bytessaman malik
#58 3196976-58.patch906 bytessakthivel m
#57 afterpatch.png13.28 KBasha nair
#57 beforePatch.png20.55 KBasha nair
#55 3196976-55.patch772 bytesnikhil_110
#51 afterpatch.png65.73 KBdishakatariya
#51 Before patch.png14.07 KBdishakatariya
#49 After-patch.png62.06 KBShubham Sharma 77
#49 Before-patch.png71.75 KBShubham Sharma 77
#46 Screenshot from 2021-11-09 12-29-31.png5.34 KBvikashsoni
#46 Screenshot from 2021-11-09 12-28-28.png5.09 KBvikashsoni
#44 after-patch.png35.68 KBradheymkumar
#44 before-patch.png35.85 KBradheymkumar
#43 3196976-43.patch771 bytesgauravvvv
#42 3196976-42.patch994 bytesgauravvvv
#40 Before Patch.png290.32 KBroshanibhangale
#40 After Patch.png274.54 KBroshanibhangale
#35 3196976-25.patch1.17 KBAgnesh Tank
#35 After_Patch_applied.png329.27 KBAgnesh Tank
#35 Before patch applied.png351.88 KBAgnesh Tank
#34 before.png9.47 KBmarcusvsouza
#34 after.png9.53 KBmarcusvsouza
#31 After Patch 3196976 up.png280.04 KBchetanbharambe
#31 Before Patch 3196976 up.png282.23 KBchetanbharambe
#31 Patch Applied 3196976.png180.8 KBchetanbharambe
#30 after_patch_whiteline.png21.38 KBguilhermevp
#30 before_patch-whiteline.png22.39 KBguilhermevp
#27 Error displayed.png24.9 KBmanojithape
#25 3196976-after-patch.png6.89 KBindrajithkb
#25 interdiff_13-25.txt907 bytesindrajithkb
#25 3196976-25.patch1.17 KBindrajithkb
#23 After Patch 3196976.png287.85 KBchetanbharambe
#23 Before Patch 3196976.png317.38 KBchetanbharambe
#22 whitelineafter.png116.5 KBrinku jacob 13
#22 whitelinebefore.png117.42 KBrinku jacob 13
#15 after_patch.png5.19 KBadalbertov
#13 white-line-3196976-13.patch1.19 KBaaron.ferris
#11 white-line-3196976-11.patch1.17 KBaaron.ferris
#8 3196976-8.patch476 bytesabhijith s
#7 White-line-below-footer.png70.73 KBbhumikavarshney
#3 footer white line.png38.5 KBaaron.ferris
Screenshot 2021-02-06 at 15.46.39.png40.56 KBgauravvvv

Issue fork drupal-3196976

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

Gauravmahlawat created an issue. See original summary.

mherchel’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this.

Can you give me steps on how to reproduce?

aaron.ferris’s picture

StatusFileSize
new38.5 KB

I can reproduce this on a fresh install of Drupal, there is what appears to be a single pixel white line across the entire bottom of the site.

1. Pull fresh Drupal 9 build
2. Spin up local environment
3. Enable Olivero
4. Add a node with enough content to fill the viewport
5. Scroll to the bottom of the page

Ive added a red background to <html> to showcase this more obviously.

This is on Chrome Version 88.0.4324.192 - Mac OSx.

Edit: Change theme to Bartik - no white line.

aaron.ferris’s picture

I can't seem to see where this is coming from, Bartik has a background colour on the body which is why it doesnt show with that theme, although removing this property the white line shows in that theme as well.

Further info: I can only recreate this when logged in, which seems to suggest it's related to the toolbar and the way the page is padded out when the toolbar is visible/active. Im still looking into it.

gauravvvv’s picture

Status: Postponed (maintainer needs more info) » Active
aaron.ferris’s picture

Isolated this to the toolbar module. Uninstalling it and the white line disappears.

At this point im unsure if this issue sits in the right place as the problem exists cross theme (masked by background colours on the body), but for my implementation i've just repositioned the footer 1px relatively, to cover the line. Yes its hacky and not the right way of fixing this, but at this stage it's an easy fix for the sake of a 1px line.

Attaching code snippet that resolves this for me:

.user-logged-in.toolbar-fixed {
 .site-footer {
    position: relative;
    top: 1px;
  }
}
bhumikavarshney’s picture

Status: Active » Needs review
StatusFileSize
new70.73 KB

Hi @aaron.ferris ,
After using your suggested changes the White line below footer issue is resolved.
Thanks

abhijith s’s picture

StatusFileSize
new476 bytes

Adding patch based on #6.Please check

aaron.ferris’s picture

I’m not convinced it’s the right fix, but if we want to roll with it we will need to provide the pcss file as well.

I’ll do this later unless someone wants to jump in ahead of me.

aaron.ferris’s picture

Status: Needs review » Needs work
aaron.ferris’s picture

StatusFileSize
new1.17 KB

Attaching patch as above.

aaron.ferris’s picture

Status: Needs work » Needs review
aaron.ferris’s picture

StatusFileSize
new1.19 KB

Missed an '&'!!

aaron.ferris’s picture

adalbertov’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new5.19 KB

Hello people, i have tried patch #13. The line was gone after the patch. The code also looks ok for me so I'm moving the issue to RTBC. I'm also adding a print of the result.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 13: white-line-3196976-13.patch, failed testing. View results

spokje’s picture

Please do not ask the testbot to try again until #3207086: [HEAD BROKEN] Consistent failure in MonthDatePluginTest is fixed.

spokje’s picture

#3207086: [HEAD BROKEN] Consistent failure in MonthDatePluginTest was committed. Ordered retest and put this issue back to RTBC per #15.

spokje’s picture

Status: Needs work » Reviewed & tested by the community
lauriii’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

Tagging for subsystem maintainer review

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.

rinku jacob 13’s picture

StatusFileSize
new117.42 KB
new116.5 KB

patch #13 successfully applied for 9.3.x-dev and 9.2.x-dev. thanks @aaron.ferris

chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new317.38 KB
new287.85 KB

Verified and tested patch #13.
Patch applied successfully and looks good to me.

Testing Steps:
# Install Olivero Theme
# Goto: Home Page
# Scroll down to footer -> User is able to see the white line below the footer

Expected Results:
# User should not see white line below the footer

Actual Results:
# User is able to see the white line below the footer

Looks good to me.
Can be a move to RTBC.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 13: white-line-3196976-13.patch, failed testing. View results

indrajithkb’s picture

Status: Needs work » Needs review
StatusFileSize
new1.17 KB
new907 bytes
new6.89 KB

Hi @aaron.ferris thanks for the patch, it's helps to remove the white space under the footer, but it's adding a white space between layout-main-wrapper and footer

Attaching the SS after patch #13.
image

So am adding new patch with margin-bottom:-1px this resolving the current issue. Please review my patch.

manojithape’s picture

Assigned: Unassigned » manojithape
manojithape’s picture

Assigned: manojithape » Unassigned
Status: Needs review » Needs work
StatusFileSize
new24.9 KB

@Indrajith KB: At the time of applying patch#25 getting an error and not able to apply the patch. Please refer attached screenshot. Due to this error moving this ticket to "Needs Work" status.

indrajithkb’s picture

Status: Needs work » Needs review
guilhermevp’s picture

StatusFileSize
new22.39 KB
new21.38 KB

Patch #30 works as intended. Not moving to RTBC because still needs subsystem maintainer review.

White line appears in clean 9.3.x.

1

Patch removes the line:

2

chetanbharambe’s picture

StatusFileSize
new180.8 KB
new282.23 KB
new280.04 KB

Verified and tested patch #25.
Patch applied successfully and looks good to me.

Testing Steps:
# Install Olivero Theme
# Goto: Home Page
# Scroll down to footer -> User is able to see the white line below the footer

Expected Results:
# User should not see white line below the footer

Actual Results:
# User is able to see the white line below the footer

Looks good to me.
Can be a move to RTBC

chetanbharambe’s picture

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

Status: Reviewed & tested by the community » Needs review

This still needs subsystem maintainer review.

marcusvsouza’s picture

StatusFileSize
new9.53 KB
new9.47 KB

The patch in comment #29 works fine and corrects the problem.

Agnesh Tank’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new351.88 KB
new329.27 KB
new1.17 KB

Verified and tested applying patch 3196976-25
(Patch applied successfully and looks good )

Status: Reviewed & tested by Community

Testing Steps:

  1. # Install Olivero Theme & Set as default
  2. 
# Goto: Home Page

  3. # Scroll down to footer -> User is able to see the white line below the footer

Expected Output:


  • # User should not see white line below the footer

Actual Output:


  • # User is able to see the white line below the footer
indrajithkb’s picture

Status: Reviewed & tested by the community » Needs review

Hi @Agnesh Tank thanks for your time on working this issue, but for now we need to wait for subsystem maintainer review as mentioned in #33. So for now we can keep the issue with needs review status.

Right now you have uploaded the same patch of #25, i think you mistakenly done this.
When you are reviewing the patch then no need to upload the same patch, just attach SS if you have and please take care of above comments on the issues which you are planning to work on. I can see you are new to contribution, so i hope this will help you...!
I am confirming your account, Happy contributing...!!!

Agnesh Tank’s picture

Hi @ Indrajith KB I went through the whole ticket and patch 25 was what i saw as patch.. so I applied and tested.. yes I am new to this getting use to this .. I am not aware of some term like "need to wait for subsystem maintainer review ".. So might have gone forward with testing. I uploaded the patch as evidence of the testing dine.. thanks for correcting will be taking note of this in moving forward.

mherchel’s picture

Title: White line below footer » Olivero: White line below footer
Priority: Normal » Minor
bnjmnm’s picture

The prior solutions will address the symptoms in some use cases, but I found the underlying cause, and that will address the issue altogether. It is due an element near the end of the page markup:

<div id="drupal-live-announce" class="visually-hidden" aria-live="polite" aria-busy="false"></div>

This element exists for screenreaders and other assistive technology. There's no need to see it on a page. The .visually-hidden class is intended to (suprise!) visually hide it from the page while keeping it present for assistive tech.

The issue is due to .visually-hidden style not FULLY hiding the element.

.visually-hidden {
    position: absolute !important;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px;
    height: 1px; /* This 1px height is creating the "white line" at the bottom of the page, you're seeing a 1px tall "hidden" element 🤦‍♂️ */ 
    word-wrap: normal;
}

So this can be addressed by finding a different way to visually hide #drupal-live-announce", or perhaps even improving the entire .visually-hidden style to prevent future problems like this.

roshanibhangale’s picture

Assigned: Unassigned » roshanibhangale
StatusFileSize
new274.54 KB
new290.32 KB

Verified and tested patch #25 on the drupal 9.3.x-dev version. Patch applied successfully.

Testing Steps:

  1. Install Drupal 9.3.x-dev version
  2. Set Olivero theme as admin and default theme (from Appearance)
  3. Create a Basic article page add the long text in the title field.
  4. Save and Verify the title of the article page.
  5. Scroll dow to the footer, observe that the user able to see the white line.

Expected Result:

  1. The white line should not appear below the footer.

Actual Results:

  1. User is not able to see the white line.

Please refer attached screenshot.
This is can be moved to RTBC.

roshanibhangale’s picture

Assigned: roshanibhangale » Unassigned
Status: Needs review » Reviewed & tested by the community
gauravvvv’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new994 bytes

Provided a patch as per the solution suggested in #39. Please review.
no need for interdiff as using different way for the solution.

gauravvvv’s picture

StatusFileSize
new771 bytes
radheymkumar’s picture

StatusFileSize
new35.85 KB
new35.68 KB

Patch #30 working fine
After patch while line below the footer has gone
for ref sharing screenshot

bnjmnm’s picture

Re #44

Patch #30 working fine
After patch while line below the footer has gone
for ref sharing screenshot

There is no patch #30. Note that any patch prior to #43 is not worth testing as it's not a good approach to addressing the issue.

Since confirmation #43 changes the approach, another set of screenshots to prove it works may be useful... but once those are provided they do not need to be re-provided by other users. 25% of this issue is currently screenshots 😀. That last set of screenshots should include some area below the browser window so it is clear the line is gone and not just because the screenshot range cropped it out.

vikashsoni’s picture

Applied patch #43 working fine after patch white line in footer disappear
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.

Shubham Sharma 77’s picture

StatusFileSize
new71.75 KB
new62.06 KB

Applied patch #43 applied successfully in drupal-9.5.x-dev
For ref sharing screenshots...
We can move this ticket to RTBC.

dishakatariya’s picture

Assigned: Unassigned » dishakatariya

i will review this issue.

dishakatariya’s picture

Assigned: dishakatariya » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new14.07 KB
new65.73 KB

Verified and tested patch #43 on the drupal 9.5.x-dev version. Patch applied successfully.
Testing Steps:

1.Install Drupal 9.5.x-dev version
2.Set Olivero theme as admin and default theme (from Appearance)
3.Scroll down to the footer, observe that the user able to see the white line.
Expected Result:

The white line should not appear below the footer.
Actual Results:

User is not able to see the white line.
Please refer attached screenshot.
This is can be moved to RTBC.

bgreco’s picture

#43 fixes the issue for me as well.

gauravvvv’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

height: 0; is not a good solution due to accessibility according to https://webaim.org/techniques/css/invisiblecontent - I think we should find a different solution.

nikhil_110’s picture

StatusFileSize
new772 bytes

Re-rolled Patch #13. please review.

marcusvsouza’s picture

Status: Needs work » Needs review
asha nair’s picture

StatusFileSize
new20.55 KB
new13.28 KB

Applied patch #13. It removes the white line at the footer. Adding screenshots for reference

sakthivel m’s picture

StatusFileSize
new906 bytes

#58 Please review the patch

saman malik’s picture

Assigned: Unassigned » saman malik
saman malik’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new772 bytes
new22.83 KB
new22.6 KB

Verified and tested patch #55 on the drupal 9.5.x-dev version. The patch was applied successfully.
Testing Steps:
1.Install Drupal 9.5.x-dev version
2. Set Olivero theme as admin and default theme (from Appearance)
3. Scroll down to the footer, and observe that the user can see the white line.
Expected Result:
The white line should not appear below the footer.
Actual Results:
White line visible.
Please refer attached screenshot.
After applying patch, Now is looking fine to me- no white line appear
This can be moved to RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

A solution that uses #height won't work because of #54

Does the solution in #58 work? And is it correct - will it work for people using assistive tech?

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.

Harish1688’s picture

Status: Needs work » Needs review
StatusFileSize
new757.17 KB
new745.65 KB

Hi,

Found the issue in Drupal version 10.1 and tried the patch latest patch but that's not working with version, may be CSS could be changed in new version. please review the patch.
created a patch for this White-line-below-footer-3196976-61.patch, attached a screenshot.

Harish1688’s picture

StatusFileSize
new470 bytes

sorry missed the patch in last comment.
White-line-below-footer-3196976-61.patch

pradipmodh13’s picture

StatusFileSize
new309.52 KB

Hello @Harish1688,
I had checked this issue on Drupal 10.1 with fresh installation but didn't find this white line gap.
Can you share steps so i can reverify.
For reference attached screenshot.

nod_’s picture

Priority: Minor » Normal
Issue tags: +Needs accessibility review

The patch in #64 is something else entirely.

What needs to be sorted out is the accessibility of the approach in #55 vs. #58 as asked in #61

saman malik’s picture

Assigned: saman malik » Unassigned
gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
StatusFileSize
new104.1 KB
new104.46 KB

Applied patch #43 on Drupal 9.5.x-dev
The patch #worked perfectly issue got fixed
For Refer sharing screenshot.

gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
heni_deepak’s picture

StatusFileSize
new77.73 KB
new40.1 KB

#13 patch applied successfully.

andy-blum’s picture

Title: Olivero: White line below footer » Update .visually-hidden class
Component: Olivero theme » system.module
Issue summary: View changes
Issue tags: -Needs subsystem maintainer review
StatusFileSize
new759 bytes

Per @bnjmnm in #39, this is not an Olivero issue, but a wider problem with the visually-hidden class. As @alexpott points out in #54, we can't set the element to 0px by 0px.

Based on the example provided in the A11Y Project website, I'm providing a patch to alter the visually hidden class.

This patch does the following:

  1. Alters the selector string to .visually-hidden:where(:not(:focus, :focus-within, :active)). This keeps the selector specificity the same, but does not apply to any elements that have focus, or a child element with focus, or is an active link.
  2. replaces the deprecated clip property with the clip-path property, which is supported for all D10 browsers (but not IE11, so don't backport this).
  3. adds inset: -100vh auto auto -100vw; to move the element fully off the page to the left and top, even if it's normal position would be fully bottom-left.
  4. adds white-space: nowrap;

While the inset was not provided as part of the A11Y Project's example, it does appear to be necessary to remove this thin line, perhaps because it's the absolute last item on the page?

andy-blum’s picture

andy-blum’s picture

Ratan Priya’s picture

StatusFileSize
new754 bytes
new428 bytes

Fixed failed custom command for comment #71.

Status: Needs review » Needs work

The last submitted patch, 74: 3196976-74.patch, failed testing. View results

Shubham Sharma 77’s picture

Status: Needs work » Needs review
StatusFileSize
new430 bytes
new728 bytes

Fixed failed commands on #74 against 10.1.x
Attached reroll patch against Drupal 10.1.x

andy-blum’s picture

Patch #76 causes some problems which seem to be related to using inset: 0;

On a fresh installation with patch #76, we now have a horizontal scrollbar, and visually hidden elements still have a width/height within the viewport. The element in the screenshot below is a contextual link that has some .visually-hidden rules overridden.

If we modify the inset values back to "-100vh auto auto -100vw", however, the horizonal scrollbar disappears, and our element no longer takes up space within the viewport.

Note: the second screenshot of the browser's styles has changed the overflow styles from "hidden" to "hidden !important". This has no effect as the style is only overridden with additional "hidden" values.

andy-blum’s picture

StatusFileSize
new439.81 KB

Doing some additional digging, the exact element causing this overflow appears to be the contextual links button for the Olivero search block. That block has it's styles deliberately overriding position:relative, causing the contextual link button's offsetParent to be the header, and it's positioned absolutely at the edge of the viewport.

While this is an Olivero-specific issue, I still think we ought to be using patch #74 and adjusting the tests as needed.

bnjmnm’s picture

Patch #76 should be ignored.

Working from #74, I reviewed a subset of the failing tests and they all appear to be due to .visually-hidden now being too hidden for our PHP tests to access. For example, I couldn't find any way to get #drupal-live-announce contents with a PHP call, but fortunately it's still available if we use JS to get it so

$this->getSession()->evaluateScript("document.querySelector('#drupal-live-announce').textContent");

still gets us what we need. Methods such as $page->find() or $assertSession->elementTextContains() were not able to find the element. It's possible there's a test method that can do this I'm not aware of, but the ->evaluateScript() is an option I know will work.

Given that our PHP tests can't see these .visually-hidden elements, we need to confirm they aren't hidden from Assistive Tech. I confirmed it is fine with Voiceover on all modern OSX browsers, but this will need to be checked with Narrator, NVDA, and JAWS on Windows too. A confirmation that Drupal.announce()/#drupal-live-announce will be sufficient.

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

bnjmnm’s picture

@VladimirAus I'm closing your merge request to avoid confusion that might arise from the assumption that the most recent activity is the most up-to-date, but in this case it's taking the solution back to an approach that was decided against over a year ago in #39. It's great to have people participating in issues, but if it's done without reading the full history of the issue (which can be a long read), the changes can be disruptive and hurt the chances of it ever being completed.

gauravvvv’s picture

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.

anupamkhosla1993@gmail.com’s picture

Hi @bnjmnm, why don't we adopt Bootstrap 5's margin: -1px fix for `.visually-hidden` to prevent layout bugs? On focus, we revert to browswer default `margin: 0` so that things like 'skip to main content' behave like normal. If there could be things in legacy code or other themes that rely on original non margin values then we can at least target the `#drupal-live-announce` id and apply `margin: -1px` to it.

Even in Drupal 11, for logged users, we have this recurring layout issue where the `#drupal-live-announce` element causes a 1px white line (gap) at the bottom of the page in themes like Olivero. Even though the element is `position: absolute`, it contributes to the Scrollable Overflow of the document because it sits at the end of the (Static Position). This forces the browser to extend the canvas by 1px, creating a visible gap below the footer.

Why do we have this bug, as far as I have researched:

https://www.w3.org/TR/css-position-3/
> see § 4 Absolute Positioning Layout Model. It can overlap in-flow content or other absolutely positioned elements, and is included in the scrollable overflow area of the box that generates is containing block. This positioning scheme is called absolute positioning.

The word 'scrollable overflow' is key here. Combine this with the following fact from the docs, https://www.w3.org/TR/CSS2/visudet.html 10.6.4 Absolutely positioned, non-replaced elements - point 2

> 2. 'top' and 'bottom' are 'auto' and 'height' is not 'auto', then set 'top' to the static position,

That leaving top/bottom/left/right to auto makes the absolute posiitioned element act like kind of static. If we apply bottom: 0 it fixes the 1px white line gap, but it is not a good solution.

The Solution We should align Drupal's .visually-hidden utility with Bootstrap 5 (and HTML5 Boilerplate) by adding margin: -1px.

Bootstrap 5 Source: View on GitHub

Proposed Patch We should update core/modules/system/css/components/hidden.module.css to include the negative margin, while ensuring we reset it during interaction states.

Proposed css:

.visually-hidden {
  position: absolute !important;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  word-wrap: normal;
  margin: -1px; /* white line at the bottom fix*/
}

.visually-hidden:focus {
  margin: 0;
}

/**
 * The .focusable class extends the .visually-hidden class to allow
 * the element to be focusable when navigated to via the keyboard.
 */
.visually-hidden.focusable:active,
.visually-hidden.focusable:focus-within {
  position: static !important;
  overflow: visible;
  clip: auto;
  width: auto;
  height: auto;
  margin: 0; /*or revert to make sure broswer defaults gets applied*/
}

PHPUnit Tests: Ran FunctionalJavascript/ModuleFilterTest.php.

Result: PASS.

The screen reades should work fine too.

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.

marksmith’s picture

Precise root cause and fix
Building on #39 and #85, here is another detailed explanation of why #drupal-live-announce creates the 1px white strip and scrollbar, and a targeted fix.

Root cause
#drupal-live-announce has position: absolute with no top, bottom, left, or right set. Per the CSS spec, when an absolutely positioned element has top: auto, it is placed at its static position - the position it would occupy in normal flow. Because this element is near the end of the , its static position lands at or beyond the bottom of the page content (in testing: top: 1401.11px, matching 100vh exactly).

The browser's scrollHeight is computed as ceil() of the maximum layout extent of all content, including absolutely positioned elements that fall within the scrollable overflow of their containing block. ceil(1401.11) = 1402, while clientHeight = 1401 -> 1px of scrollable overflow -> scrollbar + 1px white strip visible at max scroll.

This happens regardless of zoom level or viewport size, because the element's static position always tracks the end of the page content, which itself is driven by min-block-size: 100vh (a fractional CSS pixel value at any non-integer device pixel ratio).

Fix
Change #drupal-live-announce to position: fixed; top: 0. Fixed elements are explicitly excluded from scrollable overflow calculations, so they can never contribute to scrollHeight. Without top: 0, the element retains its auto-computed position which can still leak into scroll calculations. The element is already visually hidden via clip and overflow: hidden, so this change has zero visual or functional impact. Screen readers access aria-live regions regardless of their CSS positioning.

css

#drupal-live-announce {
  position: fixed;
  top: 0;
}

This is more targeted than modifying the entire .visually-hidden class, which risks regressions in other components as discussed in #54, #79, and requires no changes to PHP tests because the element remains in the DOM and is still accessible via JS as document.querySelector('#drupal-live-announce').textContent.