User Theming with Tailwind CSS

The other day I was busy with the setup and config of a project where I want people to be able to swap out their pages theme quite easily.

Then it kind of dawned on me how different thinking in Tailwind is vs using something like Bootstrap or I guess Zurb might still exist?

I think a lot of Tailwinds appeal comes in the fact that is feels like a Framework but does not run like a framework.

With Bootstrap for the most part you are using at best a small % of the actual frameworks classes. Most people would still include the whole framework - be it for just in case or uncertainty - you still end up with a ton of extra code.

I guess these days it hardly matters, and for anyone building using something like Nuxt, Reactjs and fam or some other "edge" js trend - the size of your css is the last of your concerns.

But if you are using Tailwind css then a person naturally just benefits from an optimized payload. Since unlike Bootstrap or any other css framework you don't need to opt-out, just by writing your styles as you need them you are opting-in.

That results in automatically optimized css for your project. The rub comes when you actually do want to get a bit frameworky. You know, actually have "unused" code in your project that can always be used to change layout or colours based on user settings maybe.

** While requesting the above feature from Tailwind, someone pointed out that it will actually become available in v4.1 of Tailwind so that is pretty cool.

With that I guess there is not much to complain about anymore, and actually having that ability will be a great convenience for many theme developers also.

Since if you can't easily export major chunks of the framework you are using to make them available for "user settings" then it becomes a case of either writing all of those bits yourself or crudely copying it from the framework into your own files.

So with that addition I do hope to see a lot more Tailwind based page builders for Wordpress and Drupal and not to mention it just makes everything more unified and convenient.



0
0
0.000