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 to use the Stylus theme variables from inside components

    Help
    3
    5
    2827
    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.
    • Dobromir
      Dobromir last edited by

      Is it a bad practice to require the stylus vars file to be able to use the colors from inside a component?

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

        Certainly not. Import stylus vars files care-free 🙂

        1 Reply Last reply Reply Quote 0
        • V
          vuchl last edited by

          How would one do that anyway?

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

            import 'quasar/src/themes/quasar.core.variables.styl'
            
            1 Reply Last reply Reply Quote 0
            • Dobromir
              Dobromir last edited by Dobromir

              Or you could do @import '~src/themes/app.variables.styl' which goes up to the root and searches down. This way if you change your file`s position later on, you wont have to worry compared to when using “…/…/…/” syntax.

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