Skip to content

Commit 61852ef

Browse files
committed
Disable colors in Edge and Internet Explorer (fixes #417)
1 parent 13e1d06 commit 61852ef

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/browser.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ function useColors() {
4949
return true;
5050
}
5151

52+
// Internet Explorer and Edge do not support colors.
53+
if (typeof navigator !== 'undefined' && navigator.userAgent && !navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
54+
return false;
55+
}
56+
5257
// is webkit? http://stackoverflow.com/a/16459606/376773
5358
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
5459
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||

0 commit comments

Comments
 (0)