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

    How use a personal color ?

    Framework
    1
    1
    314
    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.
    • A
      adalineloch last edited by Shone

      How use a personal color ?

      my common.variables.styl :

      $primary   = #f07f0A
      $secondary = #303f47
      $tertiary  = #555
      $myColor = #f4ba7f
      

      my app.styl (css) :

      @import '~variables'
      .text-myColor
        color $myColor
      .bg-myColor
        background-color $myColor
      

      for style css and use on my pages it’s ok

      in my page :

      import { colors } from 'quasar'
      
      let primaryColor = colors.getBrand('primary') 
      let myColor = colors.getBrand('myColor') 
      
      console.log(primaryColor) => ok return #f07f0A
      console.log(myColor) => not ok return null
      

      if change my code :

      colors.setBrand('myColor','#f4ba7f')
      let primaryColor = colors.getBrand('primary') 
      let myColor = colors.getBrand('myColor') 
      
      console.log(primaryColor) => ok return #f07f0A
      console.log(myColor) => not ok return #f4ba7f
      

      But I again need to declare the color for $myColor
      It is possible to get back the color of myColor directly of the file common.variables ?

      thanks,

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