Skip to content

Conversation

@jquense
Copy link
Contributor

@jquense jquense commented May 19, 2020

Quick attempt to fail more loudly when theme() misses a property. Error messages could probably use some copy editing.

Also b/c postcss-functions doesn't expose the current node, it's awkward to throw and error, and it's less helpful than it could be pointing to the file instead of the location that is busted.

closes #1797

@jquense
Copy link
Contributor Author

jquense commented Aug 3, 2020

friendly ping

@bradlc bradlc changed the base branch from master to theme-function-errors October 15, 2020 09:29
@bradlc bradlc merged commit 3d1943d into tailwindlabs:theme-function-errors Oct 15, 2020
@bradlc
Copy link
Contributor

bradlc commented Oct 15, 2020

Thanks @jquense! Going to merge this then look at making some some additions to provide error messages similar to those in the VS Code extension (e.g. colors.red.50 not found, did you mean colors.red.500?), then will hopefully get this on to master 💪

adamwathan pushed a commit that referenced this pull request Oct 19, 2020
* feat: throw when theme does not have requested path (#1799)

* Add suggestions to theme function errors

Co-authored-by: Jason Quense <[email protected]>
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.

Is it intentional that theme() doesn't throw when property doesn't exist?

2 participants