Skip to content

Conversation

@adamwathan
Copy link
Member

@adamwathan adamwathan commented Nov 23, 2017

Still WIP

This PR does a bunch of stuff:

  • Makes module names more consistent so each generator matches the name we want to expose to the user for that module

  • Adds a new modules key to the config file where you can customize how Tailwind generates each module

  • Missing keys in the config now use the default values for those keys; this was already happening in some places but it's now consistent

  • Allows specifying the generated variants for a given module in the config file, including not generating responsive variants for a given module if desired:

    {
        // ...
        options: {
            // ...
            modules: {
                // ...
                appearance: [],
                backgroundColors: ['responsive', 'hover'],
                zIndex: ['responsive'],
            }
        }
    }
  • Allows disabling a module:

    {
        // ...
        options: {
            // ...
            modules: {
                // ...
                whitespace: false,
            }
        }
    }
  • Moves hard-coded decisions about which utilities get which variants by default into the default config file instead

Still to do:

  • Add support for focus variants in config file
  • Refactor the generateUtilities plugin to make it easier to write some tests for the new configuration features
  • Write those tests

@adamwathan adamwathan merged commit 45eff65 into master Nov 24, 2017
@adamwathan adamwathan deleted the modularize branch November 24, 2017 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants