Ionic only for Desktop and iOS

we are using Ionic 5 (with Angular) only for Desktop, surface devices and iOS.

As far as I know the components change their styling based on the current device.

I’m wondering if it’s possible to remove the Android specific code in order to reduce the bundle size?

I don’t think that is a very prudent thing to do.

You can remove some stuff from variables.scss, but that is about it as a quick win I would think - but not a big gain - and you will be required to do some regression checks.

Then next you find yourself messing in the depths of many components, only removing a few specific lines related to the Material Design parts. Then you will be tasked with the regression tests after generating your own ionic library.

The efforts for removing that will go exponentially high - which compared to the imho insignificant bundle reduction. It is not worth it.

Is this a hard requirement or just a quick question to see if it is a quick win?

Short answer, no, but it’s not really a big deal in this case.

The code for the component and styles will get bundled together, and the components will only load the styles needed for the platform.

So there will never be a case where the android styles get loaded.

As far as removing the styles, it’s never really something we intend to support. As the styles are bundled together, it would be quite tough to allow for that level of customization. And in terms of bundle size, the overall size of the styles is not that much compared to other assets (like images/videos).