From 50e084e464815c3425722cd9c7c9d6005d49290d Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Tue, 3 Dec 2024 22:42:46 +0800 Subject: [PATCH] feat: support the custom svg icon in sidebar. add follow link. --- options.ts | 6 ++--- src/assets/styles/globals.css | 37 ++++-------------------------- src/components/header/Header.astro | 6 ++++- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/options.ts b/options.ts index b00df74..4801392 100644 --- a/options.ts +++ b/options.ts @@ -145,10 +145,10 @@ const options: z.input = { link: 'https://github.com/syhily', }, { - name: '知乎', - icon: 'icon-zhihu-square-fill', + name: 'Follow', + icon: '', type: 'link', - link: 'https://www.zhihu.com/people/syhily', + link: 'https://app.follow.is/share/feeds/54772566650461214', }, { name: '微信', diff --git a/src/assets/styles/globals.css b/src/assets/styles/globals.css index 0c9dbb3..9376f9b 100644 --- a/src/assets/styles/globals.css +++ b/src/assets/styles/globals.css @@ -548,6 +548,10 @@ justify-content: center; } +.btn-icon span svg { + margin: 28%; +} + .btn-icon:hover, .btn-icon:active, .btn-icon:focus { @@ -579,39 +583,6 @@ font-size: 1.325rem; } -.btn-icon .icon-status { - position: absolute; - left: 0; - top: 0; - z-index: 1; -} - -.icon-status { - display: block; - font-size: 11px; - line-height: 1; - min-width: 20px; - margin: 1px; - padding: 2px 3px; - border-radius: var(--radius-lg); - color: #fff; - background-color: var(--bg-danger); -} - -.icon-status.status-top { - left: 0; - top: 0; -} - -.icon-status.status-right { - left: auto; - top: 0; - right: 0; - -webkit-transform: translate(50%, -50%); - -ms-transform: translate(50%, -50%); - transform: translate(50%, -50%); -} - @media (max-width: 767.98px) { .btn-icon.btn-md { width: 2.125rem; diff --git a/src/components/header/Header.astro b/src/components/header/Header.astro index 03f48e7..0ffbbb0 100644 --- a/src/components/header/Header.astro +++ b/src/components/header/Header.astro @@ -127,7 +127,11 @@ import options from '@/options'; class="btn btn-dark btn-icon btn-circle button-social" > - + {!social.icon.startsWith(' + ) : ( + + )} );