Quasar: Caption in QExpansionItem does not respect colors used in `header-class`

Created on 8 Jul 2019  路  8Comments  路  Source: quasarframework/quasar

Describe the bug
In code, create a QExpansionItem component. Add header-class with text and background colors.
Example:

        <q-expansion-item
          expand-separator
          default-opened
          group="somegroup"
          icon="fas fa-cogs"
          label="The Label"
          caption="The Caption"
          header-class="text-white bg-primary"
        >

In this case, the background is blue, the label text and icon are white, but the caption is black.

image

It is caused by this in quasar.styl:

    &--caption
      color rgba(0, 0, 0, .54)

Of course, someone can override this with CSS, but the expected result would be the caption would adhere to the passed color in header-class property.

bug

All 8 comments

<q-expansion-item dark

ugh, of course.

Has this really been fixed? I still get expansion items that have captions in black when labels are white, with Quasar 1.5.11.

@mickey58github if you're asking this then something is misunderstood. pls supply a codepen

@rstoenescu - please have a look here: https://codepen.io/mickey58/pen/XWJVdoa

@mickey58github Add property 'dark'
https://codepen.io/Hawkeye64/pen/KKwZMpa

You can do something like this to make it reactive to Dark mode:

:dark="$q.dark.isActive"

Thanks - sorry, I misunderstood that one needs to specify "dark" as a prop to get it.

It would be worth to mention in the API doc for q-expansion-item that "dark" has this intended "side-effect" on the caption color, https://quasar.dev/vue-components/expansion-item#QExpansionItem-API

@hawkeye64 :dark="$q.dark.isActive" is implicit

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adwidianjaya picture adwidianjaya  路  3Comments

tombarfoot picture tombarfoot  路  3Comments

mesqueeb picture mesqueeb  路  3Comments

danikane picture danikane  路  3Comments

jigarzon picture jigarzon  路  3Comments