Skip to content

Commit 3a7456a

Browse files
authored
Tighten metric header layout and inline help text (#2)
1 parent 1c3b4fc commit 3a7456a

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Prometheus Formatter Extension/Resources/prometheus-formatter.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@
584584
.pf-family-header {
585585
display: flex;
586586
gap: 0.35em;
587-
padding: 0.26em 0.5em;
587+
padding: 0.18em 0.4em;
588588
cursor: pointer;
589589
background-color: var(--pf-family-header-bg);
590590
border-radius: 10px;
@@ -608,7 +608,7 @@
608608
display: flex;
609609
align-items: flex-start;
610610
justify-content: center;
611-
padding-top: 0.05em;
611+
padding-top: 0;
612612
}
613613
614614
.pf-family-toggle svg {
@@ -629,22 +629,22 @@
629629
.pf-family-header-content {
630630
display: flex;
631631
flex-direction: column;
632-
gap: 0.2em;
632+
gap: 0.05em;
633633
min-width: 0;
634634
}
635635
636636
.pf-family-title-row {
637637
display: flex;
638638
flex-wrap: wrap;
639-
gap: 0.35em;
639+
gap: 0.2em;
640640
align-items: baseline;
641-
padding: 0.2em 0.2em;
642-
border-radius: 8px;
641+
padding: 0.1em 0.1em;
642+
border-radius: 5px;
643643
background-color: var(--pf-family-row-bg);
644644
}
645645
646646
.pf-family-name {
647-
font-size: 0.92em;
647+
font-size: 0.88em;
648648
font-weight: bold;
649649
color: var(--pf-metric-name-color);
650650
}
@@ -664,12 +664,12 @@
664664
.pf-family-meta-row {
665665
display: flex;
666666
flex-wrap: nowrap;
667-
gap: 0.4em;
668-
font-size: 0.78em;
667+
gap: 0.2em;
668+
font-size: 0.74em;
669669
align-items: baseline;
670670
min-width: 0;
671671
color: var(--pf-fg);
672-
padding: 0 0.2em 0.1em 0.2em;
672+
padding: 0 0.1em 0.03em 0.1em;
673673
}
674674
675675
.pf-family-help {
@@ -678,6 +678,8 @@
678678
white-space: nowrap;
679679
overflow: hidden;
680680
text-overflow: ellipsis;
681+
font-size: 0.74em;
682+
margin-left: 0.2em;
681683
color: var(--pf-family-help-color);
682684
}
683685
@@ -1109,7 +1111,7 @@
11091111
const typeLabel = family.type ? family.type : 'unknown';
11101112
const helpText = family.help && family.help.trim() ? escapeHtml(family.help) : 'No HELP provided';
11111113
const unitHtml = family.unit
1112-
? `<span class="pf-family-unit">unit: ${escapeHtml(family.unit)}</span>`
1114+
? `<div class="pf-family-meta-row"><span class="pf-family-unit">unit: ${escapeHtml(family.unit)}</span></div>`
11131115
: '';
11141116
const headerClass = options.headerMatch ? ' pf-family-header-hit' : '';
11151117
const openAttr = options.open ? ' open' : '';
@@ -1124,11 +1126,9 @@
11241126
<span class="pf-family-name">${escapeHtml(family.name)}</span>
11251127
<span class="pf-family-pill pf-family-type">type: ${escapeHtml(typeLabel)}</span>
11261128
<span class="pf-family-pill pf-family-count">series: ${seriesCount}</span>
1127-
</div>
1128-
<div class="pf-family-meta-row">
1129-
${unitHtml}
11301129
<span class="pf-family-help">${helpText}</span>
11311130
</div>
1131+
${unitHtml}
11321132
</div>
11331133
</summary>
11341134
<div class="pf-family-body">

0 commit comments

Comments
 (0)