From 5120f1e74f9e5afa2cf08bbb46ef9104bc2da274 Mon Sep 17 00:00:00 2001 From: Adrien Date: Sun, 20 Aug 2023 20:06:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20not-centered=20AvatarSelec?= =?UTF-8?q?tor=20rendering=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/avatar_selector.rs | 14 ++++---------- src/components/avatar_selector.scss | 9 ++++++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/components/avatar_selector.rs b/src/components/avatar_selector.rs index 6b66c9e..e14be4b 100644 --- a/src/components/avatar_selector.rs +++ b/src/components/avatar_selector.rs @@ -35,21 +35,15 @@ pub fn AvatarSelector(cx: Scope) -> Element { }, }, rect { - width: "90", - height: "90", + x: "10", + y: "10", + width: "80", + height: "80", rx: "12", fill: "url('#avatar-gradient')", filter: "url('#avatar-shadow')", stroke: "grey", }, - // rect { - // x: "7.5", - // y: "7.5", - // width: "75", - // height: "75", - // fill: "transparent", - // stroke: "grey", - // }, }, img { class: ClassName::PICTURE, diff --git a/src/components/avatar_selector.scss b/src/components/avatar_selector.scss index cb9fe27..db6e999 100644 --- a/src/components/avatar_selector.scss +++ b/src/components/avatar_selector.scss @@ -4,11 +4,14 @@ aspect-ratio: 1; .picture { + $height: 65%; + $margin: calc(100% - $height) / 2; + position: absolute; - height: 75%; + height: $height; aspect-ratio: 1; - bottom: 17.5%; - right: 18%; + top: $margin; + right: $margin; } }