Skip to content

Commit

Permalink
use data attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
langermank committed Nov 13, 2024
1 parent 078ad33 commit fa7f11c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/react/src/DialogV1/Dialog.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
top: 0;
left: 50%;
z-index: 999;
/* stylelint-disable-next-line primer/responsive-widths */
width: 440px;
max-height: 80vh;
margin: 10vh auto;
background-color: var(--bgColor-default);
Expand All @@ -34,11 +32,16 @@
box-shadow: var(--shadow-floating-large);
transform: translateX(-50%);

@media screen and (--viewportRange-narrow) {
&:where([data-width='default']) {
/* stylelint-disable-next-line primer/responsive-widths */
width: 440px;
}

&:where([data-width='narrow']) {
width: 320px;
}

@media screen and (--viewportRange-wide) {
&:where([data-width='wide']) {
/* stylelint-disable-next-line primer/responsive-widths */
width: 640px;
}
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/DialogV1/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ const Dialog = forwardRef<HTMLDivElement, InternalDialogProps>(
{...props}
{...getDialogProps()}
className={clsx({[classes.Dialog]: enabled}, className)}
data-width={props.wide ? 'wide' : props.narrow ? 'narrow' : 'default'}
>
<IconButton
icon={XIcon}
Expand Down

0 comments on commit fa7f11c

Please sign in to comment.