[ui] precache layouts and element classes