Skip to content

Commit ebe4834

Browse files
committed
fix(QExpansionItem): switch-toggle-side colors are now correct
When using switch-toggle-side on QExpansionItem with an :icon prop, the icon was turning grey and the expand arrow was turning black — the opposite of the expected behavior (#18008). Root cause: QItem.sass applies `color: $grey-7` to all `--side` sections generically. When switchToggleSide is off the arrow's QItemSection uses `side=true`; when switched on it uses `avatar=true`. Swapping those JS props (as attempted in the previous commit) broke layout indentation and min-width because `avatar`/`side` control geometry, not just color. Fix: CSS-only approach using :has() selectors in QExpansionItem.sass: - The avatar section wrapping the toggle icon is forced to $grey-7 (grey) - The side section wrapping a regular icon is forced to inherit color (full) This fixes colors without touching the JS layout props whatsoever, so indentation, min-width, and padding remain correct in all configurations. Closes #18008
1 parent eefc703 commit ebe4834

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

ui/src/components/expansion-item/QExpansionItem.sass

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
.q-expansion-item
22

3+
.q-item__section--avatar:has(> &__toggle-icon)
4+
color: $grey-7
5+
6+
.q-item--dark .q-item__section--avatar:has(> &__toggle-icon)
7+
color: rgba(255,255,255,.7)
8+
9+
.q-item__section--side:has(> .q-icon):not(:has(> &__toggle-icon))
10+
color: inherit !important
11+
312
&__border
413
opacity: 0
514

0 commit comments

Comments
 (0)