Types for custom configs // Tailwind philosophy
davidgovea opened this issue · 2 comments
Hi @TVke -- this is an issue without a clear solution, but I wanted to open the issue for discussion.
Here's my problem:
I really like that tailwind limits my choices of margin, color, etc. In my opinion, having to choose between a limited number of spacings leads to more maintainable & consistent styling code. If left to pixel-level margin possibilities, I'll probably style a component slightly differently on any given day.
In this commit the default config and typescript definitions were changed to include all "intermediate" sizings. Now instead of mT12
--mT16
, there is also 13, 14, 15.
In our team's opinion, this goes against the philosophy of tailwind. The Refactoring UI book discusses sizing scales a bit, and for our team, it's just too much power!
Now -- tailwind is also extensible, so the choice you've made is totally valid... it's your default config! Users of this library can use any config they like, straight out of tailwind (which is awesome).
This exposed a shortcoming of the typescript definitions though -- they don't consider custom configs.
SO -- how could this be achieved?
- with a types-generator tool? input custom config, get an override
tailwind.d.ts
? - input config at runtime?
- This library shares a lot of concepts with
react-native-style-tachyons
- They use a runtime
build(config)
function: see here
- This library shares a lot of concepts with
going to keep brainstorming -- for now I've just locking my projects to v1.1.6
Thanks for reading!
Hi @davidgovea
I understand your problem with this change. I did this change as I think the options are a bit limited when you come in the higher values.
To this day I'm still doubting my decision and if you really would like it back to the old way, you can always submit a PR and I wil thoroughly review it and probably make the change.
That is when there is a page in the docs about the things you suggested in your comment.
This condition is because the reason for this change was that I had no idea of the possibilities and got frustrated by the limits of the basic config.
Hope you understand and welcome an PR for this.
greetings
Thomas
I see that the expanded config file is no longer the default - thanks for that!