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

    Why is app.scss not acting globally?

    Help
    2
    2
    20
    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.
    • C
      chillikid last edited by

      Hi,

      I have
      css: [“app.scss”],

      in my config, but it appear my app.scss is not acting globally and I have to import it into all my components. However any variables I put in quasar.variables.scss act globally in all my components.

      I’ve done a bit more testing and it is a strange situation.

      1/. I declare variables in app.scss then use them in a page - I get a variable not defined error.
      2/. I put an @import app.scss into the page - now they work - BUT that obviously defeats the point of having global variables.
      3/. I then tried @import app.scss into quasar.variables.scss (as the variables in quasar.variables.scss were acting globally) - I get an error message that app.scss is already being loaded.

      So it looks like something is certainly wrong.

      4/. I then created styles.scss and @import it into quasar.variables.scss . Now the variables in styles.scss all work globally as expected. However, this doesn’t seem the correct way and I would like to understand what is actually going wrong with app.scss.

      Any ideas on what is happening?

      beets 1 Reply Last reply Reply Quote 0
      • beets
        beets @chillikid last edited by

        @chillikid I think the way quasar is working here, is that any component that has <style lang="scss"> will get quasar.variables.scss imported first, but it won’t import any other file.

        If you’re just looking to define vars, why not just put them in the quasar.variables.scss file?

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