Why there are two themes to choose during the building process?
-
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?
-
I got the same concern. Anyone can answer this question?
-
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 -
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. -
@a47ae if i want to show the websites material theme to android/pc visitors and ios theme to ios visitors, what should i do?
-
@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.
-
@qyloxe is there any preferred way to detect the visiting device in reverse proxy side?
-
@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.
-
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
-
@nothingismagick when you can detect it the theme is already loaded. so i wonder why there are two theme here.
-
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.
-
@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.