  We study the origin of high-redshift, compact, quenched spheroids (red
nuggets) through the dissipative shrinkage of gaseous discs into compact
star-forming systems (blue nuggets). The discs, fed by cold streams, undergo
violent disc instability (VDI) that drives gas into the centre (along with
mergers). The inflow is dissipative when its timescale is shorter than the star
formation timescale. This implies a threshold of 0.28 in the cold-to-total mass
ratio within the disc radius. For the typical gas fraction 0.5 at z=2, this
threshold is traced back to a maximum spin parameter of 0.05, implying that
half the star-forming galaxies contract to blue nuggets, while the rest form
extended stellar discs. Thus, the surface density of blue galaxies is expected
to be bimodal about 10^9 Msun/kpc^2, slightly increasing with mass. Blue
nuggets are expected to be rare at low z when the gas fraction is low. The blue
nuggets quench to red nuggets by complementary internal and external
mechanisms. Internal quenching by a compact bulge, operating as a fast mode and
especially at high z, may involve starbursts, stellar and AGN feedback, or
Q-quenching. Quenching due to hot-medium haloes above 10^{12} Msun provides
maintenance and a slower mode at low redshift. These predictions are confirmed
in simulations and are consistent with observations at z=0-3.
