chore: canvas cleanup betterer styles object notation edition (#76315)

Co-authored-by: drew08t <drew08@gmail.com>
This commit is contained in:
Nathan Marrs
2023-11-01 10:25:26 -06:00
committed by GitHub
parent a38c9d4f44
commit 124bf6bfa9
22 changed files with 354 additions and 409 deletions

View File

@@ -147,36 +147,36 @@ export const serverItem: CanvasElementItem<ServerConfig, ServerData> = {
};
export const getServerStyles = (data: ServerData | undefined) => (theme: GrafanaTheme2) => ({
bulb: css`
@keyframes blink {
0% {
fill-opacity: 0;
}
50% {
fill-opacity: 1;
}
100% {
fill-opacity: 0;
}
}
`,
server: css`
fill: ${data?.statusColor ?? 'transparent'};
`,
circle: css`
animation: blink ${data?.blinkRate ? 1 / data.blinkRate : 0}s infinite step-end;
fill: ${data?.bulbColor};
stroke: none;
`,
circleBack: css`
fill: ${outlineColor};
stroke: none;
opacity: 1;
`,
outline: css`
stroke: ${outlineColor};
stroke-linecap: round;
stroke-linejoin: round;
stroke-width: 4px;
`,
bulb: css({
'@keyframes blink': {
'0%': {
fillOpacity: 0,
},
'50%': {
fillOpacity: 1,
},
'100%': {
fillOpacity: 0,
},
},
}),
server: css({
fill: data?.statusColor ?? 'transparent',
}),
circle: css({
animation: `blink ${data?.blinkRate ? 1 / data.blinkRate : 0}s infinite step-end`,
fill: data?.bulbColor,
stroke: 'none',
}),
circleBack: css({
fill: outlineColor,
stroke: 'none',
opacity: 1,
}),
outline: css({
stroke: outlineColor,
strokeLinecap: 'round',
strokeLinejoin: 'round',
strokeWidth: '4px',
}),
});