Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
fix: 4.5:1 ratio for devtool colors in both light and dark theme (#142)
Browse files Browse the repository at this point in the history
* fix: 4.5:1 ratio for devtool colors in both light and dark theme

* consts
  • Loading branch information
straker committed Mar 4, 2020
1 parent c6fd790 commit 35a3f4d
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,31 @@ const cancelIdleCallback = rIC.cancel;
let React;
let ReactDOM;

// contrasted against Chrome default color of #ffffff
const lightTheme = {
serious: '#d93251',
minor: '#d24700',
text: 'black'
};

// contrasted against Safari dark mode color of #535353
const darkTheme = {
serious: '#ffb3b3',
minor: '#ffd500',
text: 'white'
};

const theme =
window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
? darkTheme
: lightTheme;

const boldCourier = 'font-weight:bold;font-family:Courier;';
const critical = 'color:red;font-weight:bold;';
const serious = 'color:red;font-weight:normal;';
const moderate = 'color:orange;font-weight:bold;';
const minor = 'color:orange;font-weight:normal;';
const defaultReset = 'font-color:black;font-weight:normal;';
const critical = `color:${theme.serious};font-weight:bold;`;
const serious = `color:${theme.serious};font-weight:normal;`;
const moderate = `color:${theme.minor};font-weight:bold;`;
const minor = `color:${theme.minor};font-weight:normal;`;
const defaultReset = `font-color:${theme.text};font-weight:normal;`;

let idleId: number | undefined;
let timeout: number;
Expand Down

0 comments on commit 35a3f4d

Please sign in to comment.