Modules needs to have external css files like we have projects and they should be modified to take effect in that perticuler module only.
With Mendix 9 having different CSS files for different modules this will add a nice saparation of concerns to the UI layer
The idea behind the modularization architecture is not to have compartmentalized CSS.
The goal is that you create module and style it according to MX best practices, using the variables in the variables module.
This will allow your module to seamlessly fit into the design system of who ever will use it.
you can always choose to scope your css by using a “widgetname-wrap” class on the outer div.