-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colors do not work in browser console #52
Comments
I've added a PR to fix this. In the mean time, here's a fork: |
Browser support means bundlers don't break if you accidentally ship this package to a browser. The suggested implementation only works in Chrome, which is not the Web. I'm happy to revisit this when Safari and Firefox support this too. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The readme claims browser support; however it seems this is a bit of a bait-and-switch. The
.browser.js
version does nothing and is hardcoded for every function just to return strings unchanged. Looking through the previous issues I understand the reasoning for this, which is to support certain bundlers which were throwing errors.Working version
Here is a
picocolors.ts
that works in the Chrome dev console. The only thing I've changed is to delete theisColorSupported
function at the top which uses the Nodetty
module. Also I converted it to Typescript so I can easily move it between projects in a single file.I would happily open a PR to replace the stub version with this (or the JS equivalent), assuming this project is not abandoned...
The text was updated successfully, but these errors were encountered: