No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Q-Rating and colors

    Framework
    2
    2
    817
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      spectrolite last edited by spectrolite

      So here’s a gitter conversation that I thought may interest other people too:

      Hey 😀 for the q-rating component is there anyway of changing the base & active colour like there was previously? i found the defaults of grey unselected and yellow active to suit my layout more however the stylus variables ($rating-grade-color, $rating-active-grade-color) seem to have been removed in 0.14? Thanks!

      Laurent @spectrolite 12:25
      @Plooze a quick look at the source code and styles tells me that q-rating is based on one color only, that you may set through the color property (no need to fiddle with css). The current behavior is to dim the opacity of unselected items. I agree grey would suit even more use cases and provides better contrast, so if you log an issue, ping me and I’ll support it.

      Laurent @spectrolite 12:34
      @Plooze there’s a trick to get to what you want though.

       <style lang="stylus">
      
        .q-rating i.active 
          filter grayscale(0)
          -webkit-filter grayscale(0)
      
        .q-rating i 
          filter grayscale(100%)
          -webkit-filter grayscale(100%)
      
      </style>
      

      This makes unselected stars grey and gives them their color back when selected. Color is controlled from the tag as detailed in beta docs.

      btw $rating-grade-color still exists (but it’s easier to just use q-rating’s color property), and $rating-active-grade-color has indeed been dropped (or at least I didn’t find it in sources).
      _

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        A simple note: QRating also has a “color” prop in v0.14

        1 Reply Last reply Reply Quote 0
        • First post
          Last post