Skip to content

Commit fb3f55e

Browse files
author
Robert Crocker
committed
Fixed the legend and tooltip text colors in dark mode and light mode.
1 parent 4e4b297 commit fb3f55e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/App.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import portfolio from '../data/portfolio.json';
99
import penguins from '../data/penguins.json';
1010
import fruit from '../data/fruit.json';
1111

12-
import GlobalStyle from './styles/globals';
1312
import { Container } from './styles/componentStyles';
1413

1514
function App() {

src/components/ColorLegend.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ const Legend = styled.div`
1616
const LegendTitle = styled.text`
1717
font-size: 14px;
1818
font-family: Tahoma, Geneva, Verdana, sans-serif;
19-
fill: ${(props) => props.theme.textColor};
19+
fill: ${(props) => props.theme.legendTextColor};
2020
`;
2121

2222
const LegendLabel = styled.text`
2323
font-size: 12px;
2424
font-family: Tahoma, Geneva, Verdana, sans-serif;
25-
fill: ${(props) => props.theme.textColor};
25+
fill: ${(props) => props.theme.legendTextColor};
2626
`;
2727

2828
export const ColorLegend = ({

src/components/Tooltip.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const Tooltip = ({
2626
axisBaseLineColor: '#ebebeb',
2727
legendBackgroundColor: '#ffffff',
2828
legendBorder: '1px solid #ebebeb',
29-
tooltipTextColor: '#e5e5e5',
29+
tooltipTextColor: '#212121',
3030
tooltipBackgroundColor: '#ffffff',
3131
tooltipBorder: '1px solid #ddd',
3232
tooltipShadow: `0 0 10px 0 rgba(80, 80, 80, 0.2)`,

src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const LightTheme = {
55
strokeGridLineColor: '#ebebeb',
66
textColor: '#8c8c8c',
77
axisBaseLineColor: '#ebebeb',
8+
legendTextColor: '#212121',
89
legendBackgroundColor: '#ffffff',
910
legendBorder: '1px solid #ebebeb',
1011
};
@@ -13,6 +14,7 @@ const DarkTheme = {
1314
strokeGridLineColor: '#3d3d3d',
1415
textColor: '#727272',
1516
axisBaseLineColor: '#3d3d3d',
17+
legendTextColor: '#e5e5e5',
1618
legendBackgroundColor: '#1d1d1d',
1719
legendBorder: '1px solid #3d3d3d',
1820
};

0 commit comments

Comments
 (0)