From 7bbe9c3b5c800071c276eeb1987c81e502da6fe4 Mon Sep 17 00:00:00 2001 From: CyanSalt Date: Wed, 3 Apr 2024 10:57:25 +0800 Subject: [PATCH] feat(icon): separate color with stroke color --- docs/components/icon.md | 22 ++++++++++++++++++++-- src/icon/index.vue | 7 ++++--- src/select/index.vue | 2 +- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/docs/components/icon.md b/docs/components/icon.md index 544e78e..bb00690 100644 --- a/docs/components/icon.md +++ b/docs/components/icon.md @@ -184,7 +184,25 @@ View all available icons [here](https://lucide.dev/icons/). - + + + + + + + Stroke line color of the icon. + + + + - Line width of the icon. + Stroke line width of the icon. diff --git a/src/icon/index.vue b/src/icon/index.vue index 0cc71f3..cc26af9 100644 --- a/src/icon/index.vue +++ b/src/icon/index.vue @@ -51,11 +51,11 @@ const getReactionState = useReactionState() function draw(rc: RoughSVG, svg: SVGSVGElement) { emit('will-draw') getReactionState(reactions) - const strokeWidth = getLengthProperty(svg, '--r-icon-line-width') ?? 0 + const strokeWidth = getLengthProperty(svg, '--r-icon-stroke-width') ?? 0 const options: Options = { roughness: 0.5, disableMultiStroke: true, - stroke: 'var(--r-icon-color)', + stroke: 'var(--r-icon-stroke-color)', strokeWidth, fill: filled ? 'var(--r-icon-color)' : undefined, } @@ -142,7 +142,8 @@ function draw(rc: RoughSVG, svg: SVGSVGElement) {