Device-Specific Styles
Styles are often changed in script to signify something to the user. However, they can also be used to customise the look and feel of a module depending on user device settings.
In the below example, the onDocumentOpened event is used to check the device manufacturer and type. Based on the result, the font size and foreground color of all subsequent module paragraphs is changed.
<onDocumentOpened> -- Set font size for all paragraphs depending on device type if application.device.IsTablet then paragraphs.FontSize = 1.2 else paragraphs.FontSize = 0.8 end -- Set color for all paragraphs depending on device manufacturer if application.device.Manufacturer == "Apple" then paragraphs.ForegroundColor = "darkGray" end </onDocumentOpened> <sectionNoTitle> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis id quam mi. Curabitur cursus tempus risus at dictum. Proin imperdiet mauris ex, vitae facilisis magna consectetur vel. Fusce laoreet tortor in semper pulvinar. Duis nec ex diam. Quisque non turpis neque. Maecenas pretium rutrum sapien, facilisis luctus libero placerat quis. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc sodales, nunc sit amet viverra porttitor, lacus lorem fringilla mauris, id posuere enim nisi ut purus. Phasellus vehicula justo non lacus eleifend dignissim.</p> </sectionNoTitle>