Styling Overrides

Learn how to override component styles in two ways.

Customizing styles

Styles within the Ionic UI components can be overridden by the user thanks to the platform-specific class that is applied to the application’s <html> root tag.

For example, if we wanted to customize the styling for the AlertController component, we could choose to do so in the following ways.

First approach

Our first approach involves targeting the class for the platform mode, followed by the selected CSS class names for the AlertController component.

Here, we edit an application’s /src/global.scss file to add the following style rule:

Get hands-on with 1200+ tech skills courses.