Skip to content

Commit 83006a0

Browse files
committed
PD-3625 Fix spacing, alignment and typography in Names panel
Restructures the published name markup so the label sits outside the <h1> instead of nested inside it with a redundant <p> (also fixes PD-2475's mis-coloured label), restores the label-to-value spacing that a dead CSS selector was silently dropping, centers the visibility icon against its full text block instead of the top line, and applies the $body-large (18px/24px bold) and 14px bold styles called for in the Figma redlines.
1 parent 259d8a8 commit 83006a0

2 files changed

Lines changed: 43 additions & 11 deletions

File tree

‎src/app/record/components/top-bar/top-bar.component.html‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,18 +141,21 @@ <h2 header class="names-header orc-font-body" i18n="@@topBar.names">
141141
<app-panel-element
142142
[visibility]="userRecord.names.visibility.visibility"
143143
>
144-
<h1 class="name" *ngIf="creditName">
145-
<span i18n="@@topBar.publishedName" class="mat-caption">
144+
<ng-container *ngIf="creditName">
145+
<span
146+
i18n="@@topBar.publishedName"
147+
class="mat-caption description"
148+
>
146149
Published Name
147150
</span>
148-
<p class="mat-card-title published-name" id="publishedName">
151+
<h1 class="published-name" id="publishedName">
149152
{{ creditName }}
150-
</p>
151-
</h1>
153+
</h1>
154+
</ng-container>
152155
<span i18n="@@topBar.name" class="mat-caption description">
153156
Name
154157
</span>
155-
<div id="givenAndFamilyNames" class="mat-subtitle-2">
158+
<div id="givenAndFamilyNames" class="mat-subtitle-2 name-value">
156159
{{ givenNames + ' ' + familyName }}
157160
</div>
158161
</app-panel-element>

‎src/app/record/components/top-bar/top-bar.component.scss‎

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,51 @@ app-panel {
1111
width: 100%;
1212
margin-top: 16px;
1313

14-
.name,
1514
p {
16-
margin-top: 0;
15+
margin: 0;
1716
}
1817

19-
p .published-name {
20-
margin-bottom: 18px;
18+
.mat-caption.description {
19+
display: block;
20+
margin: 16px 0 8px;
21+
22+
&:first-child {
23+
margin-top: 0;
24+
}
25+
}
26+
27+
.published-name {
28+
margin: 0;
29+
font-size: 18px;
30+
line-height: 24px;
31+
font-weight: bold;
32+
}
33+
34+
.name-value {
35+
margin: 0;
36+
font-weight: bold;
2137
}
2238

2339
.other-names-container {
24-
margin-top: 18px;
40+
margin-top: 16px;
2541

2642
.other-names {
2743
margin-bottom: 0;
2844
}
2945
}
46+
47+
// Scoped to the names panel only: centre the visibility icon against
48+
// the block it belongs to instead of the default flex `stretch`, so it
49+
// stays aligned when the block wraps published name + name onto several
50+
// lines. `app-panel-element` is shared by other panels, so this is kept
51+
// local rather than changed at the source.
52+
::ng-deep .row-with-privacy {
53+
align-items: center;
54+
}
55+
56+
::ng-deep app-panel-privacy {
57+
margin-top: 0;
58+
}
3059
}
3160

3261
app-top-bar-actions {

0 commit comments

Comments
 (0)