I think the key here would be to limit both – no buildings higher than ~6 stories (~30m) and a limit on urban boundaries, either enforced by land planning or economics.
Standard mansion blocks of six stories still have a much higher population density than suburban sprawling single-family homes while avoiding some/all of the issues with too high a population density – two-lane roads are usually quite sufficient and the sun does reach the ground from time to time.
See e.g. Berlin and Munich for (IMHO) decent examples of this.