Skip to content

Commit 6e18f61

Browse files
authored
[6.x] Vertically center combobox tags (#13132)
1 parent 27279f5 commit 6e18f61

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

resources/css/core/utilities.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
/* =Jay. Sometimes this is handy e.g. the text inside the command palette searchbox */
4343
text-box: cap alphabetic;
4444
}
45+
@utility st-text-trim-ex-alphabetic {
46+
text-box: ex alphabetic;
47+
}
4548

4649
@utility placeholder-xs {
4750
/* =Jay. The default of 1em on field inputs feels a bit clumsy/big */

resources/js/components/ui/Combobox.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ defineExpose({
472472
:key="getOptionValue(option)"
473473
class="sortable-item mt-2"
474474
>
475-
<Badge pill size="lg">
475+
<Badge pill size="lg" class="[&>*]:st-text-trim-ex-alphabetic">
476476
<div v-if="labelHtml" v-html="getOptionLabel(option)"></div>
477477
<div v-else>{{ __(getOptionLabel(option)) }}</div>
478478
@@ -502,6 +502,12 @@ defineExpose({
502502
z-index: var(--z-index-portal)!important;
503503
}
504504
505+
@supports(text-box: ex alphabetic) {
506+
[data-ui-badge] {
507+
padding-block: 0.65rem;
508+
}
509+
}
510+
505511
/* Override the hardcoded z-index of Reka's popper content wrapper. When there's a modal present, we need to ensure the popper content is above it. We can't use a direct descendant selector because the modal is inside a portal, so instead we'll check to see if there is modal content present. */
506512
body:has([data-ui-modal-content]) [data-reka-popper-content-wrapper] {
507513
z-index: var(--z-index-modal)!important;

0 commit comments

Comments
 (0)