Force Android material design when previewing in web browser



  • Onsen UI seems to default to iOS styling for components when previewing in web browser.

    To force material styling, I am told to:

    • Call ons.disableAutoStyling()
    • Add modifier="material" in every component

    Adding the modifier attribute for each and every component is a tedious task.

    Is there a better way where I can easily do a single setting change and see how the app would look like under iOS and Android?


  • Onsen UI

    @wetfeet Simply run ons.platform.select('android'); after including onsenui.js. If it’s just for testing, you can also append ?platform=android to the url or use an Android device in Development Tools.



  • @Fran-Diox Great! This is brilliant! I am pretty sold on Onsen! :thumbsup:


Log in to reply