Chapter 9 of my favorite textbook presents the standard analysis of a tariff (a tax on imports) and shows that it reduces economic welfare as measured by the sum of producer surplus, consumer surplus, and tax revenue. Even though the tariff makes domestic producers better off and raises some revenue for the government, these gains are more than offset by losses to consumers, leading to a deadweight loss.
Most economists would recognize the consumer surplus loss as a reduction in economic welfare. The difference between what domestic producers gain and what consumers lose is this “producer surplus” loss so no disagreement there either. Consumer losses also include the extra funds that go into tariff revenues but most economists see government spending as having at least some value. So to include all of the tariff revenue as part of the reduction in economic welfare is either sloppy analysis or just a minor slip up on the part of Dr. Mankiw. But then his quiz on the effects of a Chinese export tariff included this question:
What happens to total welfare in China, as measured by the sum of consumer surplus, producer surplus, and tax revenue?