Skip to content

Commit 61130b8

Browse files
authored
Fix SelectPanel close button alignment in narrow viewports (#6327)
1 parent 24ae58a commit 61130b8

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

.changeset/silver-melons-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/react': patch
3+
---
4+
5+
Fix SelectPanel close button alignment in narrow viewports.
9 Bytes
Loading

packages/react/src/SelectPanel/SelectPanel.module.css

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,25 @@
3030
}
3131

3232
.Wrapper[data-variant='modal'] .Title {
33-
margin-top: var(--base-size-8); /* styling specific to the modal variant */
33+
margin-top: var(--base-size-8);
34+
/* styling specific to the modal variant */
35+
}
36+
37+
/*
38+
* Align SelectPanel header text with AnchoredOverlay close button
39+
*
40+
* Only applies to anchor variant in narrow viewports. When the feature flag
41+
* `primer_react_select_panel_fullscreen_on_narrow` is enabled, we align the
42+
* title with the close button position (similar to modal variant approach).
43+
*
44+
* TODO: Remove this workaround after the feature flag is gone. We should
45+
* pick one way to render the close button instead of having two different
46+
* implementations.
47+
*/
48+
.Wrapper[data-variant='anchored'] .Title {
49+
@media screen and (--viewportRange-narrow) {
50+
margin-top: var(--base-size-8);
51+
}
3452
}
3553

3654
.Subtitle {

0 commit comments

Comments
 (0)