Skip to content

Commit

Permalink
fix(lightbox): fix a11y color contrast on the close button
Browse files Browse the repository at this point in the history
DSW-198
  • Loading branch information
gcornut committed Aug 7, 2024
1 parent 51d19dd commit d15d2ee
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- `Lightbox`: fix a11y color contrast on the close button.

## [3.7.5][] - 2024-07-25

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
position: fixed;
top: $lumx-spacing-unit * 3;
right: $lumx-spacing-unit * 3;
z-index: 1;
}

&__wrapper {
Expand Down
25 changes: 13 additions & 12 deletions packages/lumx-react/src/components/lightbox/Lightbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import classNames from 'classnames';
import { createPortal } from 'react-dom';

import { mdiClose } from '@lumx/icons';
import { ColorPalette, Emphasis, IconButton, IconButtonProps } from '@lumx/react';
import { IconButton, IconButtonProps } from '@lumx/react';
import { DIALOG_TRANSITION_DURATION, DOCUMENT } from '@lumx/react/constants';
import { Comp, GenericProps, HasTheme } from '@lumx/react/utils/type';
import { getRootClassName, handleBasicClasses } from '@lumx/react/utils/className';
Expand Down Expand Up @@ -145,17 +145,18 @@ export const Lightbox: Comp<LightboxProps, HTMLDivElement> = forwardRef((props,
style={{ zIndex }}
>
{closeButtonProps && (
<IconButton
{...closeButtonProps}
ref={closeButtonRef}
className={`${CLASSNAME}__close`}
color={ColorPalette.light}
emphasis={Emphasis.low}
icon={mdiClose}
theme={theme}
type="button"
onClick={onClose}
/>
<div className={`${CLASSNAME}__close`}>
<IconButton
{...closeButtonProps}
ref={closeButtonRef}
emphasis="low"
hasBackground
icon={mdiClose}
theme="dark"
type="button"
onClick={onClose}
/>
</div>
)}
<ClickAwayProvider callback={!preventAutoClose && onClose} childrenRefs={clickAwayRefs}>
<div ref={childrenRef} className={`${CLASSNAME}__wrapper`} role="presentation">
Expand Down

0 comments on commit d15d2ee

Please sign in to comment.