Skip to content

Commit 0fcc17a

Browse files
committed
styling: ActionMenu - Align optional icons - move styles to parent and use subgrid
1 parent 90be68b commit 0fcc17a

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

app/components/02.molecules/action-menu/ActionMenu.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,18 @@ const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
202202
}
203203
204204
.action-menu-list {
205+
display: grid;
206+
grid-template-columns: auto 1fr auto;
207+
205208
list-style: none;
206209
padding: 0;
207210
margin: 0;
208211
209212
.action-menu-list-item {
213+
grid-column: 1 / -1;
214+
display: grid;
215+
grid-template-columns: subgrid;
216+
210217
&:not(:last-child) {
211218
border-bottom: var(--_item-divider);
212219
}

app/components/02.molecules/action-menu/ActionMenuItemCore.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ watch(
5757
<style lang="css">
5858
@layer components {
5959
.action-menu-item-core {
60+
--_gap: var(--action-menu-item-gap, 1.2rem);
6061
--_surface-hover: var(--action-menu-item-surface-hover, light-dark(var(--slate-01), var(--slate-09)));
6162
--_text-color: var(--action-menu-item-text-color, light-dark(var(--slate-09), var(--slate-01)));
6263
--_icon-size: var(--action-menu-item-icon-size, 2rem);
@@ -67,9 +68,9 @@ watch(
6768
box-sizing: border-box;
6869
cursor: pointer;
6970
display: grid;
70-
grid-template-columns: auto 1fr auto;
71+
grid-template-columns: subgrid;
7172
align-items: center;
72-
gap: 1.2rem;
73+
7374
width: 100%;
7475
padding-inline: var(--_padding-inline);
7576
padding-block: var(--_padding-block);
@@ -92,6 +93,9 @@ watch(
9293
}
9394
9495
.action-menu-item-icon {
96+
grid-column: 1;
97+
margin-inline-end: var(--_gap);
98+
9599
display: flex;
96100
align-items: center;
97101
justify-content: center;
@@ -101,12 +105,16 @@ watch(
101105
}
102106
103107
.action-menu-item-label {
108+
grid-column: 2;
104109
white-space: nowrap;
105110
overflow: hidden;
106111
text-overflow: ellipsis;
107112
}
108113
109114
.action-menu-item-arrow {
115+
grid-column: 3;
116+
margin-inline-start: var(--_gap);
117+
110118
display: flex;
111119
align-items: center;
112120
flex-shrink: 0;

0 commit comments

Comments
 (0)