avoid duplicated css calculation