Skip to content

Commit d95e856

Browse files
funsaizedatscott
authored andcommitted
fix(docs-infra): align search result icon with text on mobile
On narrow viewports, the search result icon was pushed to its own flex line when the title text was too long, causing vertical misalignment. The fix wraps the title text and package badge in a single container that manages its own flex layout, preventing the icon from being separated from the text on narrow viewports. Fixes angular#68005
1 parent 13c8df6 commit d95e856

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

adev/shared-docs/components/search-dialog/search-dialog.component.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@
2727
</i>
2828
</span>
2929

30-
<!-- Page title -->
31-
<span [innerHtml]="result.labelHtml"></span>
32-
@if (result.package) {
33-
<span
34-
[innerHTML]="result.package"
35-
class="docs-search-result__label__package"
36-
></span>
37-
}
30+
<!-- Page title and package badge -->
31+
<span class="docs-search-result__label__text">
32+
<span [innerHtml]="result.labelHtml"></span>
33+
@if (result.package) {
34+
<span
35+
[innerHTML]="result.package"
36+
class="docs-search-result__label__package"
37+
></span>
38+
}
39+
</span>
3840
</p>
3941

4042
@if (result.subLabelHtml) {

adev/shared-docs/components/search-dialog/search-dialog.component.scss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ dialog {
4646

4747
.docs-search-result-icon {
4848
display: inline-block;
49+
flex-shrink: 0;
4950

5051
i {
5152
display: flex;
@@ -91,7 +92,20 @@ dialog {
9192

9293
&__label {
9394
font-weight: 600;
94-
flex-wrap: wrap;
95+
96+
&__text {
97+
display: flex;
98+
flex-wrap: wrap;
99+
align-items: baseline;
100+
gap: 0.25rem 0.5rem;
101+
flex: 1;
102+
min-width: 0;
103+
overflow-wrap: break-word;
104+
105+
> * {
106+
min-width: 0;
107+
}
108+
}
95109

96110
&__package {
97111
font-size: 0.75rem;

0 commit comments

Comments
 (0)