This article nails it on the head.
Tribalism and fear / dislike of those who are different from us are sentiments that have been around for millions of years. It is naive to assume that they will go away without first addressing the root ignorance.
I think there is a different reason that liberalism has been losing (coming from an enthusiastic Bernie supporter): as you mentioned, a lot of these causes have tremendous appeal to the professional class and professionally aspiring (of which I am one).
The problem is that automation and globalization has done a lot of damage to the working class, and we have only paid lip service to their very real suffering.
In the US at least, liberalism has been incredibly timid to the idea of drawing battle lines explicitly by class instead of just ethnicity and gender. And I think we have insufficiently addressed the economic trauma of some very real suffering people.