Use update_style_if_needed_for_element() and resolve colors via computed properties instead of forcing a full layout update.