Skip to content

Types for custom configs // Tailwind philosophy #18

@davidgovea

Description

@davidgovea

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?

going to keep brainstorming -- for now I've just locking my projects to v1.1.6

Thanks for reading!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions