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 there are two themes to choose during the building process?

    Framework
    5
    12
    1727
    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
      cst_zf last edited by

      I think it should only one default theme and the framework should recognize if a visit is from android or ios and use the correct theme at runtime.

      Why we should decide it during the building process?

      And right now, when i build a web app, how can it show the correct theme to the visitor from a mobile device?

      1 Reply Last reply Reply Quote 1
      • S
        sunceenjoy last edited by

        I got the same concern. Anyone can answer this question?

        1 Reply Last reply Reply Quote 0
        • S
          sunceenjoy last edited by

          As what I guess, those two themes support both devices and browsers other than some slight style difference , such as color or font. Also on doc page, it support many browsers without mentioning which theme to use.
          http://v0-14.quasar-framework.org/guide/browser-support.html

          1 Reply Last reply Reply Quote 0
          • a47ae
            a47ae last edited by

            The themes are only referring to the style guidelines used to create them.
            The “Material theme” sticks to the Material guidelines from Google and the “iOS theme” to Apple Human Interface guidelines.

            You can, however, choose any theme in any browser/device, the compatibility is the same.
            Due how the build process works you cannot switch themes during runtime (also this would ship lots of unneeded resources for your customers), this is why you have to set the theme at build time.

            C 1 Reply Last reply Reply Quote 0
            • C
              cst_zf @a47ae last edited by

              @a47ae if i want to show the websites material theme to android/pc visitors and ios theme to ios visitors, what should i do?

              qyloxe 1 Reply Last reply Reply Quote 0
              • qyloxe
                qyloxe @cst_zf last edited by

                @cst_zf said in Why there are two themes to choose during the building process?:

                @a47ae if i want to show the websites material theme to android/pc visitors and ios theme to ios visitors, what should i do?

                you can use reverse proxy (nginx/openresty/…) and with the same URI ("/index.html" in example), based on request headers (browser type) serve appropriate internal code ("/index_ios.html" or “/index_mat.html”). BTW using reverse proxy is almost always a preferred solution novadays.

                C 1 Reply Last reply Reply Quote 1
                • C
                  cst_zf @qyloxe last edited by

                  @qyloxe is there any preferred way to detect the visiting device in reverse proxy side?

                  qyloxe 1 Reply Last reply Reply Quote 0
                  • qyloxe
                    qyloxe @cst_zf last edited by

                    @cst_zf it is based on HTTP header - user agent. In nginx there are at least two modules supporting detection of OS, browser, version etc.

                    In OpenResty (I prefer this solution) such a task is trivial because you have all the power of LUA scripting at the proxy level and you can do … anything.

                    1 Reply Last reply Reply Quote 0
                    • nothingismagick
                      nothingismagick last edited by

                      I would just like to point out that you can also detect the platform with great granularity from quasar itself by using $q.platform.is

                      http://quasar-framework.org/components/platform-detection.html

                      C 1 Reply Last reply Reply Quote 0
                      • C
                        cst_zf @nothingismagick last edited by

                        @nothingismagick when you can detect it the theme is already loaded. so i wonder why there are two theme here.

                        1 Reply Last reply Reply Quote 0
                        • nothingismagick
                          nothingismagick last edited by

                          I understand your point, but you can use the detection to switch between iconsets, for example. And the detection will happen before rendering takes place.

                          1 Reply Last reply Reply Quote 0
                          • nothingismagick
                            nothingismagick last edited by

                            @cst_zf - I really recommend, by the way, that you visit the discord server - you are much more likely to find help there - instead of waiting 20 days for resolution this is something that would be solved for you relatively quickly.

                            https://discord.gg/5TDhbDg

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