Skip to content

Commit fa7f11c

Browse files
committed
use data attributes
1 parent 078ad33 commit fa7f11c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

packages/react/src/DialogV1/Dialog.module.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
top: 0;
2525
left: 50%;
2626
z-index: 999;
27-
/* stylelint-disable-next-line primer/responsive-widths */
28-
width: 440px;
2927
max-height: 80vh;
3028
margin: 10vh auto;
3129
background-color: var(--bgColor-default);
@@ -34,11 +32,16 @@
3432
box-shadow: var(--shadow-floating-large);
3533
transform: translateX(-50%);
3634

37-
@media screen and (--viewportRange-narrow) {
35+
&:where([data-width='default']) {
36+
/* stylelint-disable-next-line primer/responsive-widths */
37+
width: 440px;
38+
}
39+
40+
&:where([data-width='narrow']) {
3841
width: 320px;
3942
}
4043

41-
@media screen and (--viewportRange-wide) {
44+
&:where([data-width='wide']) {
4245
/* stylelint-disable-next-line primer/responsive-widths */
4346
width: 640px;
4447
}

packages/react/src/DialogV1/Dialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ const Dialog = forwardRef<HTMLDivElement, InternalDialogProps>(
163163
{...props}
164164
{...getDialogProps()}
165165
className={clsx({[classes.Dialog]: enabled}, className)}
166+
data-width={props.wide ? 'wide' : props.narrow ? 'narrow' : 'default'}
166167
>
167168
<IconButton
168169
icon={XIcon}

0 commit comments

Comments
 (0)