CSS precalc put into own function