Skip to content

Conversation

adamwathan
Copy link
Member

Previously we were passing the current theme object to lazily evaluated config closures, but this can lead to an unfortunate amount of boilerplate if you need to check for the presence of a given key before referencing it.

This PR makes theme a function instead, where you specify the path to look up as the first argument (using dot notation), and specify a default value if that path doesn't exist as a second argument, just like the theme function available in your CSS .

Resolves #770.

@adamwathan adamwathan merged commit c5c9a7a into next Mar 16, 2019
@adamwathan adamwathan deleted the theme-closure-function branch March 16, 2019 20:44
CvX added a commit to CvX/tailwindcss that referenced this pull request Mar 17, 2019
CvX added a commit to CvX/tailwindcss that referenced this pull request Mar 17, 2019
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.

1 participant