From 7beddd6d1ae127c0927e92edf6c620881b235804 Mon Sep 17 00:00:00 2001 From: Chris Burnell Date: Mon, 22 Jan 2024 00:44:51 +0800 Subject: [PATCH] use currentColor for default line color --- package.json | 2 +- svg-sparkline.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 62b7681..0d2367f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chrisburnell/svg-sparkline", - "version": "0.0.5", + "version": "0.0.6", "description": "A Web Component for building an SVG Sparkline.", "main": "svg-sparkline.js", "scripts": { diff --git a/svg-sparkline.js b/svg-sparkline.js index f0090ea..e0916d5 100644 --- a/svg-sparkline.js +++ b/svg-sparkline.js @@ -74,7 +74,7 @@ class SVGSparkline extends HTMLElement { this.values = this.getAttribute("values").split(",") this.width = parseFloat(this.getAttribute("width")) || 160 this.height = parseFloat(this.getAttribute("height")) || 28 - this.color = this.getAttribute("color") || window.getComputedStyle(this).getPropertyValue("color") + this.color = this.getAttribute("color") || "currentColor" this.curve = this.getAttribute("curve") === "true" this.animationDuration = this.getAttribute("animation-duration") || "1s" this.endpoint = this.getAttribute("endpoint") !== "false"