It is well established that the [alpha/Fe] ratios in elliptical galaxies increase with galaxy mass. This relation holds also for early-type dwarf galaxies, although it seems to steepen at low masses. The [alpha/Fe] vs. mass relation can be explained assuming that smaller galaxies form over longer timescales (downsizing), allowing a larger amount of Fe (mostly produced by long-living Type Ia Supernovae) to be released and incorporated into newly forming stars. Another way to obtain the same result is by using a flatter initial mass function (IMF) in large galaxies, increasing in this way the number of Type II Supernovae and therefore the production rate of alpha-elements. The integrated galactic initial mass function (IGIMF) theory predicts that the higher the star formation rate, the flatter the IMF. We have checked, by means of semi-analytical calculations, that the IGIMF theory, combined with the downsizing effect (i.e. the shorter duration of the star formation in larger galaxies), well reproduces the observed [alpha/Fe] vs. mass relation. In particular, we show a steepening of this relation in dwarf galaxies, in accordance with the available observations.