use theme.light

main
Mike Fix 6 years ago committed by Michael Fix
parent c53a3f0c97
commit 48504ba1d0

@ -99,6 +99,7 @@ class Carbon extends React.PureComponent {
theme={config.windowTheme} theme={config.windowTheme}
code={this.props.children} code={this.props.children}
copyable={this.props.copyable} copyable={this.props.copyable}
light={config.theme.light}
/> />
) : null} ) : null}
<CodeMirror <CodeMirror

@ -103,20 +103,6 @@ class Themes extends React.PureComponent {
...themes ...themes
] ]
let isColorLight = color => {
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 ( return (
<div className="themes"> <div className="themes">
<Dropdown <Dropdown
@ -150,10 +136,6 @@ class Themes extends React.PureComponent {
background-color: ${highlights.background} !important; background-color: ${highlights.background} !important;
} }
:global(.window-title-container input) {
color: ${isColorLight(highlights.background || "#000000") ? "black" : "white"};
}
:global(.cm-string), :global(.cm-string),
:global(.cm-string-2) { :global(.cm-string-2) {
color: ${highlights.string} !important; color: ${highlights.string} !important;

@ -36,7 +36,7 @@ const CopyButton = React.memo(function CopyButton({ text }) {
) )
}) })
export default ({ theme, copyable, code }) => ( export default ({ theme, copyable, code, light }) => (
<div className="window-controls"> <div className="window-controls">
{theme === 'bw' ? <ControlsBW /> : <Controls />} {theme === 'bw' ? <ControlsBW /> : <Controls />}
<div className="window-title-container"> <div className="window-title-container">
@ -73,6 +73,7 @@ export default ({ theme, copyable, code }) => (
border: none; border: none;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
color: ${light ? COLORS.BLACK : COLORS.SECONDARY};
} }
.copy-button { .copy-button {

Loading…
Cancel
Save