Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Platform-specific styling classes?
Saloniq David last edited by
While I’ve looked through docs and resources, I haven’t quite managed to find an answer to this.
Does ONSEN UI contain some informational platform-specific classes? Like class “ios” when on running on iOS? Or is this problem solved only by using platform=“ios” in HTML?
I have found the automatic styling helpful but definitely in need of alteration.
@Saloniq-David Everything looks like iOS by default. Autostyling is adding a
modifier="material"attribute to every component basically. At the same time, modifiers add custom classes like
elementName--modifierName). Therefore, you can easily select an element in CSS with
.page.page--materialfor MD or
.page:not(.page--material)for iOS. Alternatively,
:not([modifier~=material]would also work.
ons.platformcontains methods to change platform styling or detect the current platform.