Scale middleware for CSS Hat 2