Yes, you could build your own framework to localize your styles. Or you could just use Tailwind.

You're misunderstanding me. I never said you should build a framework. I said frontend frameworks already provide style locality out of the box, so there is no need to introduce an additional framework (Tailwind) for that.