mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-07-15 04:43:36 +00:00
fix: oklch invalid wanring
This commit is contained in:
@@ -94,7 +94,6 @@ interface NetworkGraphCardProps {
|
|||||||
|
|
||||||
type NetworkElement = NetworkTopologyNode | NetworkTopologyEdge;
|
type NetworkElement = NetworkTopologyNode | NetworkTopologyEdge;
|
||||||
|
|
||||||
// Resolve a CSS variable to its actual computed color string for use in SVG
|
|
||||||
function resolveCssVar(varName: string, fallback: string): string {
|
function resolveCssVar(varName: string, fallback: string): string {
|
||||||
const raw = getComputedStyle(document.documentElement)
|
const raw = getComputedStyle(document.documentElement)
|
||||||
.getPropertyValue(varName)
|
.getPropertyValue(varName)
|
||||||
@@ -107,8 +106,13 @@ function resolveCssVar(varName: string, fallback: string): string {
|
|||||||
document.body.appendChild(tmp);
|
document.body.appendChild(tmp);
|
||||||
const resolved = getComputedStyle(tmp).backgroundColor;
|
const resolved = getComputedStyle(tmp).backgroundColor;
|
||||||
document.body.removeChild(tmp);
|
document.body.removeChild(tmp);
|
||||||
// getComputedStyle returns "" or "rgba(0,0,0,0)" if unresolvable
|
if (
|
||||||
return resolved && resolved !== "rgba(0, 0, 0, 0)" ? resolved : fallback;
|
!resolved ||
|
||||||
|
resolved === "rgba(0, 0, 0, 0)" ||
|
||||||
|
resolved.includes("oklch")
|
||||||
|
)
|
||||||
|
return fallback;
|
||||||
|
return resolved;
|
||||||
}
|
}
|
||||||
|
|
||||||
const NODE_W = 220;
|
const NODE_W = 220;
|
||||||
|
|||||||
Reference in New Issue
Block a user