Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions components/offscreen/offscreen-styles.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { css } from 'lit';
import { getFlag } from '../../helpers/flags.js';

const OffSCREEN_SIZELESS = getFlag('d2l-offscreen-sizeless', true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct me if I'm wrong but this should be deleted in December 2026 (this year) according to the flag's definition. Also the jira ticket this PR is linked to says the same so, just wanted to double check if this is something intended. Thank you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So 6 months is the default when creating a new flag and hence why this is set in December, but usually we have 3-release lifespans for Gaudi flags(that would be September). Nothing has been raised around this so it's safe to remove it now

const HAS_DOCUMENT = globalThis.document !== undefined;

/**
* A private helper declarations that should not be used by general consumers
*/
export const _offscreenStyleDeclarations = css`
direction: var(--d2l-document-direction, ${ !HAS_DOCUMENT ? css`unset` : (document.dir === 'rtl' ? css`rtl` : css`ltr`)}); /* stylelint-disable-line @stylistic/string-quotes */
height: ${HAS_DOCUMENT && OffSCREEN_SIZELESS ? 0 : 1}px; /* The HAS_DOCUMENT check can be removed once the d2l-offscreen-sizeless flag is removed and set to 0px */

@dbatiste dbatiste Jul 27, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I reviewed the PR that changed this, but now I am wondering what the backstory is on why we are changing the dimension from 1px to 0. IIRC, a long long time ago we discovered that screen readers would not announce elements with zero dimensions. I'm assuming that must have changed since I don't think we'd change this without testing with a screenreader.

height: 0;
inset-inline-start: -10000px;
overflow: hidden;
position: absolute !important;
white-space: nowrap;
width: ${HAS_DOCUMENT && OffSCREEN_SIZELESS ? 0 : 1}px; /* The HAS_DOCUMENT check can be removed once the d2l-offscreen-sizeless flag is removed and set to 0px */
width: 0;
`;

export const offscreenStyles = css`
Expand Down