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

    Add color

    Framework
    3
    4
    224
    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.
    • D
      dwms last edited by

      how to add color in the quasar at run time?

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        Color to what or of what?

        Scott

        1 Reply Last reply Reply Quote 0
        • D
          dwms last edited by

          As there is primary, secondary, I would like to create mine like cor1, cor2, cor3. I know I can put them in the sass file, but I would like to create them dynamically

          1 Reply Last reply Reply Quote 0
          • T
            tof06 last edited by

            Explained here : https://quasar.dev/quasar-utils/color-utils#Create-Dynamic-Custom-Colors

            Create some classes in CSS (or SASS) with a default value :

            $col1 = #123456
            
            :root 
              --q-color-col1 $col1
            
            .text-col1
              color: $col1 !important
              color: var(--q-color-col1) !important
            
            .bg-col1
              background: $col1 !important
              background: var(--q-color-col1) !important
            

            Then, you can use setBrand helper

            import { colors } from 'quasar'
            
            const { setBrand } = colors
            setBrand ('col1', '#FF0000')
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post