Migrate isInTheme behavior and handle CSS change for active theme

This refs affinitic #5741