I think this is a good idea and would be a great feature, but perhaps difficult to implement.
Do you mean removed unused classes/IDs from custom styles or all styles, including the styles in Bootstrap and/or the styles which are part of the Wappler extensions? If you excluded Bootstrap, it would probably make it much easier - but from the point of view if optimisation, Bootstrap is probably the main issue.
One of the difficulties of removing styles is that some may be used dynamically - ie not appearing on a page, but applied at runtime via Javascript for example. Simply stripping out all classes not referenced on any page could have unfortunate results. However given that Wappler ‘knows’ what classes might be used in this way - as long as only Wappler components are used - I would have thought it should be possible to remove unused CSS reliably, though dealing with such classes that might be used by Bootstrap might be a problem.
This cropped up in a thread some time ago. I suggested it might be possible to integrate Gulp for example with one of the modules available for this purposes. In fact you could do this now from within Wappler, using the terminal with modules such as those mentioned here. You would need a list of classes to be excluded to avoid the problems I mentioned. However it would certainly be nice to have a feature built in.