Skip to content

Commit f233d5c

Browse files
committed
Give default dimensions to svg icons
1 parent 8a2ab2f commit f233d5c

File tree

10 files changed

+62
-12
lines changed

10 files changed

+62
-12
lines changed

src/components/controls/Button.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ const Button = forwardRef(({ className, color, loading, children, disabled, ...p
5959
animate="anim"
6060
exit="exit"
6161
>
62-
<ArrowPathIcon className="w-[1em] h-[1em] animate-spin" />
62+
<ArrowPathIcon
63+
className="w-[1em] h-[1em] animate-spin"
64+
width="1em"
65+
height="1em"
66+
/>
6367
</motion.span>}
6468
</AnimatePresence>
6569
</button>

src/components/controls/Select.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ const Select = forwardRef(<TOption extends any>(
110110
{({ open }) => (
111111
<>
112112
{getDisplayName(value)}
113-
<ChevronDownIcon className="inline w-4 h-4 ml-2 motion-safe:transition-transform ui-open:rotate-180" />
113+
<ChevronDownIcon
114+
className="inline w-4 h-4 ml-2 motion-safe:transition-transform ui-open:rotate-180"
115+
width="1em"
116+
height="1em"
117+
/>
114118
<AnimatePresence>
115119
{open && <motion.div
116120
key="options"

src/components/navigation/Header.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ const Header = () => {
4343
aria-controls="header-items"
4444
onClick={() => setOpen(!open)}
4545
>
46-
<Bars3Icon className="w-6 h-6" />
46+
<Bars3Icon
47+
className="w-6 h-6"
48+
width="1em"
49+
height="1em"
50+
/>
4751
</Button>
4852
<div
4953
ref={itemsContainerRef}

src/components/navigation/NavDropdown.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const NavDropdown = ({ summary, children }: NavDropdownProps) => {
5252
<ChevronDownIcon
5353
className="w-5 h-5 data-[open='true']:rotate-180 transition-all"
5454
data-open={open}
55+
width="1em"
56+
height="1em"
5557
/>
5658
</summary>
5759
<div ref={containerRef} className="absolute inset-x-0 flex flex-col gap-2 px-4 py-2 bg-white border-2 rounded-lg group/dropdown border-primary md:w-fit" data-in-group>

src/components/pages/blog/ArticleBrief.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,20 @@ const ArticleBrief = ({ title, thumbnail, thumbnailAlt, readtime, teaser, author
111111
</AuthorTag>
112112
<Link href={url} color="fill-contrast" className="flex items-center gap-4 text-sm">
113113
{safeToRender && <div className="flex items-center gap-2">
114-
<BookIcon className="w-4 h-4" />
114+
<BookIcon
115+
className="w-4 h-4"
116+
width="1em"
117+
height="1em"
118+
/>
115119
{readtimeFormatter.format(readtime)}
116120
</div>}
117121
<div className="hidden w-1 h-1 rounded-full bg-neutral-600 md:block" />
118122
{safeToRender && <div className="flex items-center gap-2">
119-
<CalendarIcon className="w-4 h-4" />
123+
<CalendarIcon
124+
className="w-4 h-4"
125+
width="1em"
126+
height="1em"
127+
/>
120128
{(new Date(date)).toLocaleDateString()}
121129
</div>}
122130
</Link>

src/components/pages/blog/post/ArticleMeta.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ const ArticleMeta = ({ author, readtime, created, updated }: ArticleMetaProps) =
4949
{DotSeparator}
5050
<div className="flex items-center gap-4 text-sm">
5151
{safeToRender && <div className="flex items-center gap-2">
52-
<BookIcon className="w-4 h-4" />
52+
<BookIcon
53+
className="w-4 h-4"
54+
width="1em"
55+
height="1em"
56+
/>
5357
<time
5458
aria-label="reading time"
5559
dateTime={`${readtime} minutes`}
@@ -59,7 +63,11 @@ const ArticleMeta = ({ author, readtime, created, updated }: ArticleMetaProps) =
5963
</div>}
6064
{DotSeparator}
6165
{safeToRender && <div className="flex items-center gap-2">
62-
<CalendarIcon className="w-4 h-4" />
66+
<CalendarIcon
67+
className="w-4 h-4"
68+
width="1em"
69+
height="1em"
70+
/>
6371
<time aria-label="Date created" dateTime={created} className={`${updated ? "hidden" : ""}`}>
6472
{(new Date(created)).toLocaleDateString()}
6573
</time>

src/components/pages/front/SignupSection.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,11 @@ const SignupSection = () => {
6363
<ul aria-label="Perks" className="flex flex-wrap justify-center w-full gap-4" >
6464
{perks.map(({ title, icon: Icon }, i) => (
6565
<li key={i} className="flex flex-col items-center w-32 gap-2">
66-
<Icon className="w-12 sm:w-16 text-primary" />
66+
<Icon
67+
className="w-12 sm:w-16 text-primary"
68+
width="1em"
69+
height="1em"
70+
/>
6771
<div className="font-bold">{title}</div>
6872
</li>
6973
))}

src/pages/404.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,19 @@ const NotFound: Page = ({ pathname }) => {
2828
<p>There are no commits to be found here!</p>
2929
<div className="grid grid-cols-2 gap-2 mt-4">
3030
<LinkButton href="/" color="secondary">
31-
<HomeModernIcon className="w-4" />
31+
<HomeModernIcon
32+
className="w-4"
33+
width="1em"
34+
height="1em"
35+
/>
3236
Home
3337
</LinkButton>
3438
<Button onClick={() => router.back()} color="secondary">
35-
<ArrowUturnLeftIcon className="w-4" />
39+
<ArrowUturnLeftIcon
40+
className="w-4"
41+
width="1em"
42+
height="1em"
43+
/>
3644
Back
3745
</Button>
3846
</div>

src/pages/mail/unsubscribe.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ const UnsubscribePage: Page = ({ pathname }) => {
7676
<Button type="submit" color="secondary">
7777
{!loading
7878
? "Unsubscribe"
79-
: <ArrowPathIcon className="w-6 h-6 animate-spin" />
79+
: <ArrowPathIcon
80+
className="w-6 h-6 animate-spin"
81+
width="1em"
82+
height="1em"
83+
/>
8084
}
8185
</Button>
8286
</Form>

src/utils/swal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import withReactContent from "sweetalert2-react-content";
33
import CloseIcon from "@heroicons/react/24/solid/XMarkIcon";
44

55
const swal = withReactContent(Swal).mixin({
6-
closeButtonHtml: <CloseIcon className="w-6 h-6" />,
6+
closeButtonHtml: <CloseIcon
7+
className="w-6 h-6"
8+
width="1em"
9+
height="1em"
10+
/>,
711
customClass: {
812
icon: "mr-4"
913
}

0 commit comments

Comments
 (0)