Skip to content

Commit 8fe185e

Browse files
committed
feat: Use tailwind dimens instead of hardcoded px.
1 parent 6991e0e commit 8fe185e

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

src/components/Elements/Button/CircleButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const variants = {
1212
secondary: 'bg-ht-100 text-ht-900 hover:bg-ht-200',
1313
outlined: 'bg-ht-100 text-ht-900 hover:bg-ht-100',
1414
text: 'bg-transparent ttext-ht-900',
15-
darkfocus: 'bg-blue-900 text-yellow-400 hover:opacity-80',
15+
darkfocus: 'bg-blue-900 text-yellow-400 hover:opacity-80 dark:bg-ht-100 dark:hover:bg-ht-200',
1616
}
1717

1818
type CircleButtonProps = {

src/components/Elements/SearchBar/SearchBar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ export const SearchBar = () => {
2929

3030
return (
3131
<form
32-
className="z-[1] inline-flex flex-1 items-center rounded-full bg-white py-2 sm:relative sm:mx-0 sm:my-auto sm:flex-grow-1 dark:bg-ht-100"
32+
className="order-2 flex grow items-center gap-2 rounded-full bg-white px-4 py-2 dark:bg-ht-100"
3333
onSubmit={handleSubmit}>
3434
{usedSearchEngine?.default === false ? (
35-
<HiSparkles className="mx-[16px] size-[22px] rounded-full" />
35+
<HiSparkles className="mx-4 size-6 rounded-full" />
3636
) : (
3737
<img
38-
className={'mx-[16px] size-[24px] rounded-full bg-white p-[2px]'}
38+
className={'size-6 rounded-full bg-white p-0.5'}
3939
src={`/searchengine_logos/${usedSearchEngine.label.toLowerCase()}_logo.svg`}
4040
/>
4141
)}

src/components/Elements/UserTags/UserTags.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ export const UserTags = () => {
66
const { userSelectedTags } = useUserPreferences()
77

88
return (
9-
<div className="flex w-full flex-wrap items-center gap-2">
9+
<div className="order-4 flex w-full flex-wrap items-center gap-2">
1010
{userSelectedTags.map((tag, index) => (
1111
<span
1212
key={index}
13-
className="rounded-2xl bg-ht-900 px-[8px] py-[2px] font-medium text-white dark:bg-ht-200">
13+
className="rounded-2xl bg-ht-900 px-2 py-0.5 text-base font-medium text-white dark:bg-ht-200">
1414
{tag.value}
1515
</span>
1616
))}
17-
<div className="rounded-2xl bg-ht-900 px-[8px] py-[4px] font-medium text-white hover:bg-ht-200 dark:bg-ht-200 dark:hover:bg-ht-900">
18-
<Link to="/settings/topics" aria-label="Open settings">
19-
<TiPlus className="relative mt-[-2px] fill-white dark:hover:fill-black" />
20-
</Link>
21-
</div>
17+
<Link
18+
to="/settings/topics"
19+
aria-label="Open settings"
20+
className="rounded-2xl bg-ht-900 px-2 py-0.5 font-medium">
21+
<TiPlus className="" />
22+
</Link>
2223
</div>
2324
)
2425
}

src/components/Layout/Header.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@ export const Header = () => {
5656

5757
return (
5858
<>
59-
<header className="sticky top-0 z-[1] mx-[1%] mt-[10px] mb-0 flex flex-row flex-wrap content-center items-center gap-[10px] md:h-auto">
60-
<span className="flex items-center pt-[4px] md:w-auto md:grow-0">
61-
<i className="me-[8px]">
59+
<header className="sticky z-[1] mx-[1%] mt-3 mb-0 flex flex-row flex-wrap content-center items-center gap-2.5">
60+
<span className="order-1 flex items-center text-ht-900">
61+
<i className="relative me-2">
6262
<CgTab size={24} />
6363
</i>{' '}
6464
<Link to="/">
65-
<HackertabLogo aria-label="hackertab.dev" className="h-[16px] w-auto fill-ht-900" />
65+
<HackertabLogo aria-label="hackertab.dev" className="h-4 w-auto fill-ht-900" />
6666
</Link>
6767
<Changelog />
6868
</span>
6969
<SearchBar />
70-
<div className="inline-flex flex-row items-center gap-[8px]">
70+
<div className="order-3 inline-flex flex-row content-center gap-2 gap-y-2">
7171
{isDNDModeActive() && (
7272
<Button onClick={onUnpauseClicked} className="font-bold">
7373
<MdDoDisturbOff />
@@ -97,18 +97,17 @@ export const Header = () => {
9797
{isConnected ? (
9898
<>
9999
<img
100-
className="size-[40px] rounded-full outline-2 outline-amber-600"
100+
className="size-full rounded-full outline-2 outline-amber-600"
101101
src={user?.imageURL}
102102
/>
103-
<div className="absolute mr-0 -mb-12 ml-0 inline-block">
104-
<div className="flex items-center justify-end rounded-[12px] border-2 border-ht-100 bg-amber-600 text-[11px] font-bold text-white">
105-
<StreakIcon className="-mt-[2px] ml-0 w-[2.2em]" />{' '}
106-
<span className="me-2 justify-self-end">{user?.streak || 1}</span>
107-
</div>
103+
<div className="absolute right-0 -bottom-2 left-0 inline-block">
104+
<span className="inline-flex items-center justify-center rounded-xl bg-amber-500 py-px ps-6 pe-1.5 text-xs outline-2 outline-ht-100">
105+
<StreakIcon className="absolute -top-0.5 left-0 w-6" /> {user?.streak || 1}
106+
</span>
108107
</div>
109108
</>
110109
) : (
111-
<AvatarPlaceholder className="mt-[10px] size-[34px] rounded-[20px]" />
110+
<AvatarPlaceholder className="mt-10 size-34 rounded-xl" />
112111
)}
113112
</CircleButton>
114113
</div>

0 commit comments

Comments
 (0)