Skip to content

Commit 67fc8f5

Browse files
fix(PageHeader): Correctly add display prop (#5415)
* correctly add display prop * correctly update display prop for title * re-add missing style component * add :where selector Co-authored-by: Marie Lucca <[email protected]> --------- Co-authored-by: Marie Lucca <[email protected]>
1 parent 73da985 commit 67fc8f5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.changeset/clever-bears-jog.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 display bug for `PageHeader` component title.

packages/react/src/PageHeader/PageHeader.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,16 @@
161161

162162
.Title {
163163
/* using flex and order to display the title in the title area. */
164-
display: flex;
164+
display: block;
165165
order: var(--title-area-region-order-title);
166166
font-size: inherit;
167167
font-weight: inherit;
168168
}
169169

170+
.Title:where([data-hidden='true']) {
171+
display: none;
172+
}
173+
170174
.TrailingVisual {
171175
/* using flex and order to display the trailing visual in the title area. */
172176
display: flex;

packages/react/src/PageHeader/PageHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,7 @@ const Title: React.FC<React.PropsWithChildren<TitleProps>> = ({
535535
<Heading
536536
className={clsx(enabled && classes.Title, className)}
537537
data-component="PH_Title"
538+
data-hidden={hidden}
538539
as={as}
539540
style={style}
540541
sx={

0 commit comments

Comments
 (0)