From 48504ba1d0ba72baa3bc70948c2172a17c76a191 Mon Sep 17 00:00:00 2001 From: Mike Fix Date: Sun, 14 Apr 2019 11:10:07 -0700 Subject: [PATCH] use theme.light --- components/Carbon.js | 1 + components/Themes/index.js | 18 ------------------ components/WindowControls.js | 3 ++- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/components/Carbon.js b/components/Carbon.js index 5d0fd80..5ca8ea7 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -99,6 +99,7 @@ class Carbon extends React.PureComponent { theme={config.windowTheme} code={this.props.children} copyable={this.props.copyable} + light={config.theme.light} /> ) : null} { - var r, g, b, hsp - color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&')) - r = color >> 16 - g = color >> 8 & 255 - b = color & 255; - hsp = Math.sqrt( - 0.299 * (r * r) + - 0.587 * (g * g) + - 0.114 * (b * b) - ) - return hsp > 127.5 - } - return (
( +export default ({ theme, copyable, code, light }) => (
{theme === 'bw' ? : }
@@ -73,6 +73,7 @@ export default ({ theme, copyable, code }) => ( border: none; text-align: center; font-size: 14px; + color: ${light ? COLORS.BLACK : COLORS.SECONDARY}; } .copy-button {