Make switch to compact and small modes dynamic