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.
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.