We've moved discussions to Discord

Tailwind config is problematic

Dan Weaver
The way the Tailwind config is set up in this template feels confusing.

The config contains a large amount of duplicated default values, some of which override the defaults but most don't. Having a lot of values in the config is a good for visibility but it's unclear which are duplicates and which override the defaults. And, more importantly, the overrides exclude some of the expected default values.

Take margins for instance. None of the negative margin classes are available because the config overrides the negativeMargins key. Width is another example - all of the /12 values have been excluded.

As per the Tailwind docs, the ideal config file is as small as possible. Let Tailwind create all the rules it can then let PostCSS and PurgeCSS tidy up and optimize the ones that are required in the app.

I've submitted a pull request with a trimmed down config file that contains only two keys

  • `colors` which extends the default with the Jumpstart colors
  • `fontFamily` which overrides the default key to include the Jumpstart 'Lato' font.

    These two examples in the config show how both extends and overrides are done. There's a link to the default theme so users can quickly and easily see what default values are available to them and extend or override in their own config as they wish.

    https://gitlab.com/gorails/jumpstart-pro/merge_requests/5
Dan Weaver
The way the Tailwind config is set up in this template feels confusing.

The config contains a large amount of duplicated default values, some of which override the defaults but most don't. Having a lot of values in the config is a good for visibility but it's unclear which are duplicates and which override the defaults. And, more importantly, the overrides exclude some of the expected default values.

Take margins for instance. None of the negative margin classes are available because the config overrides the negativeMargins key. Width is another example - all of the /12 values have been excluded.

As per the Tailwind docs, the ideal config file is as small as possible. Let Tailwind create all the rules it can then let PostCSS and PurgeCSS tidy up and optimize the ones that are required in the app.

I've submitted a pull request with a trimmed down config file that contains only two keys

  • `colors` which extends the default with the Jumpstart colors
  • `fontFamily` which overrides the default key to include the Jumpstart 'Lato' font.

    These two examples in the config show how both extends and overrides are done. There's a link to the default theme so users can quickly and easily see what default values are available to them and extend or override in their own config as they wish.

    https://gitlab.com/gorails/jumpstart-pro/merge_requests/5
Notifications
You’re not receiving notifications from this thread.
© 2022 Jumpstart Pro by GoRails, LLC