chore: Removes hard-coded colors from legacy-plugin-chart-sankey (#19493)

* chore: Removes hard-coded colors from legacy-plugin-chart-sankey

* Gets opacity from the theme
This commit is contained in:
Michael S. Molina 2022-04-07 11:50:31 -03:00 committed by GitHub
parent 83c3779a6c
commit 06dee825a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,25 +34,26 @@ SankeyComponent.propTypes = {
}; };
export default styled(SankeyComponent)` export default styled(SankeyComponent)`
${({ theme }) => `
.superset-legacy-chart-sankey { .superset-legacy-chart-sankey {
.node { .node {
rect { rect {
cursor: move; cursor: move;
fill-opacity: 0.9; fill-opacity: ${theme.opacity.heavy};
shape-rendering: crispEdges; shape-rendering: crispEdges;
} }
text { text {
pointer-events: none; pointer-events: none;
text-shadow: 0 1px 0 #fff; text-shadow: 0 1px 0 ${theme.colors.grayscale.light5};
font-size: ${({ fontSize }) => fontSize}em; font-size: ${theme.typography.sizes.s}px;
} }
} }
.link { .link {
fill: none; fill: none;
stroke: #000; stroke: ${theme.colors.grayscale.dark2};
stroke-opacity: 0.2; stroke-opacity: ${theme.opacity.light};
&:hover { &:hover {
stroke-opacity: 0.5; stroke-opacity: ${theme.opacity.mediumLight};
} }
} }
.opacity-0 { .opacity-0 {
@ -62,12 +63,13 @@ export default styled(SankeyComponent)`
.sankey-tooltip { .sankey-tooltip {
position: absolute; position: absolute;
width: auto; width: auto;
background: #ddd; background: ${theme.colors.grayscale.light2};
padding: 10px; padding: ${theme.gridUnit * 3}px;
font-size: ${({ fontSize }) => fontSize}em; font-size: ${theme.typography.sizes.s}px;
color: #000; color: ${theme.colors.grayscale.dark2};
border: 1px solid #fff; border: 1px solid ${theme.colors.grayscale.light5};
text-align: center; text-align: center;
pointer-events: none; pointer-events: none;
} }
`}
`; `;