Skip to content

Open source personal finance application

refactor: fine-tune typography and component variants across multiple components

Ilya Komichevef5970c86759
diff --git a/app/components/amount/Amount.vue b/app/components/amount/Amount.vue
index 4a506c32..e342cea2 100644
--- a/app/components/amount/Amount.vue
+++ b/app/components/amount/Amount.vue
@@ -16,7 +16,7 @@ export type AmountProps = {
isShowSymbol?: boolean
precision?: number
type?: MoneyTypeNumber
- variant?: '2xs' | '3xl' | 'base' | 'sm' | 'xl'
+ variant?: '2xs' | '3xl' | 'base' | 'xs' | 'sm' | 'xl'
}
const props = withDefaults(defineProps<AmountProps>(), {
@@ -39,7 +39,8 @@ const { baseCurrencyCode, getAmountInBaseRate } = useAmount()
'!text-expense-1': props.colorize === 'expense' && props.type === 0,
'!text-income-1': props.colorize === 'income' && props.type === 1,
'text-2xs': props.variant === '2xs',
- 'text-xs': props.variant === 'sm',
+ 'text-xs': props.variant === 'xs',
+ 'text-sm': props.variant === 'sm',
'text-3xl': props.variant === '3xl',
'text-xl': props.variant === 'xl',
'text-base': props.variant === 'base',
diff --git a/app/components/categories/Name.vue b/app/components/categories/Name.vue
index 2ab79844..13fb6f3e 100644
--- a/app/components/categories/Name.vue
+++ b/app/components/categories/Name.vue
@@ -26,12 +26,12 @@ const props = defineProps<{
</template>
<!-- Base name -->
- <div class="flex items-center gap-2 text-nowrap text-sm leading-none text-3">
+ <div class="flex items-center gap-2 text-nowrap text-xs font-semibold leading-none tracking-wide text-3">
{{ props.category?.name }}
<!-- Has childs -->
<div
v-if="props.isShowDots && props.hasChildren"
- class="text-sm leading-none text-4"
+ class="text-xs leading-none text-4"
>
...
</div>
diff --git a/app/components/date/Trns.vue b/app/components/date/Trns.vue
index ad9c712a..0496fd29 100644
--- a/app/components/date/Trns.vue
+++ b/app/components/date/Trns.vue
@@ -11,7 +11,7 @@ const formattedDate = computed(() => formatDate(props.date, 'full'))
<template>
<div class="flex items-center gap-2">
- <div class="_w-10 _text-center font-secondary text-3xl">
+ <div class="_w-10 _text-center font-secondary text-3xl font-semibold">
{{ formattedDate.day }}
</div>
@@ -20,7 +20,7 @@ const formattedDate = computed(() => formatDate(props.date, 'full'))
{{ formattedDate.weekday }}
</div>
- <div class="flex gap-1 text-xs leading-none">
+ <div class="flex gap-1 text-sm font-medium leading-none text-1">
<div>{{ formattedDate.month }}</div>
<div>{{ formattedDate.year }}</div>
</div>
diff --git a/app/components/stat/categories/Round.vue b/app/components/stat/categories/Round.vue
index 25971226..443fcf3f 100644
--- a/app/components/stat/categories/Round.vue
+++ b/app/components/stat/categories/Round.vue
@@ -96,7 +96,7 @@ onLongPress(
:isShowBaseRate="false"
:isShowSymbol="false"
align="left"
- variant="sm"
+ variant="xs"
colorize="income"
/>
</div>
diff --git a/app/components/stat/chart/Wrap.vue b/app/components/stat/chart/Wrap.vue
index 4d902767..e2fab5bd 100644
--- a/app/components/stat/chart/Wrap.vue
+++ b/app/components/stat/chart/Wrap.vue
@@ -50,7 +50,7 @@ function onChangePeriod(period: Period) {
:class="{
'md:max-w-lg': props.chartView === 'half',
}"
- class="bg-item-2 mb-3 rounded-xl p-2"
+ class="mb-3 rounded-xl bg-item-2 p-2"
>
<div
v-if="statConfig.config.value?.chartShow"
@@ -60,7 +60,7 @@ function onChangePeriod(period: Period) {
<slot />
<StatChartIntervals
- :class="{ 'border-item-4 border-l': statConfig.config.value?.date.isShowQuick }"
+ :class="{ 'border-l border-item-4': statConfig.config.value?.date.isShowQuick }"
:period="statDate.params.value.intervalsBy"
:range="statDate.range.value"
@onChangePeriod="onChangePeriod"
diff --git a/app/components/stat/date/Range.vue b/app/components/stat/date/Range.vue
index 72016ba8..f0e2b04d 100644
--- a/app/components/stat/date/Range.vue
+++ b/app/components/stat/date/Range.vue
@@ -26,7 +26,7 @@ const date = computed(() => {
</script>
<template>
- <div class="flex items-center gap-1 leading-none">
+ <div class="flex items-center gap-1 leading-none tracking-wide">
{{ date }}
<data
v-if="statDate.params.value.isShowMaxRange && statDate.params.value.intervalSelected === -1"
diff --git a/app/components/trns/Item.vue b/app/components/trns/Item.vue
index 14b2f2b7..46f09d13 100644
--- a/app/components/trns/Item.vue
+++ b/app/components/trns/Item.vue
@@ -77,7 +77,7 @@ const { t } = useI18n()
v-if="trnItem.wallet"
class="flex items-center gap-2"
>
- <div class="text-xs leading-none text-4">
+ <div class="text-2xs leading-none text-4">
{{ trnItem.wallet.name }}
</div>
</div>
@@ -90,10 +90,10 @@ const { t } = useI18n()
:isShowMinus="trnItem.type === 0"
:isShowPlus="trnItem.type === 1"
:type="trnItem.type"
- :variant="props.alt ? 'sm' : 'base'"
align="right"
class="grow"
colorize="income"
+ variant="sm"
/>
<!-- Transfer -->
@@ -113,6 +113,7 @@ const { t } = useI18n()
:currencyCode="trnItem.expenseWallet.currency"
:type="0"
class="!flex items-center gap-2"
+ variant="sm"
/>
<template v-if="trnItem.incomeAmount !== trnItem.expenseAmount">
@@ -127,6 +128,7 @@ const { t } = useI18n()
:type="1"
colorize="income"
class="!flex items-center gap-2"
+ variant="sm"
/>
</template>
</div>
diff --git a/app/components/trns/List.vue b/app/components/trns/List.vue
index 6a18f2c0..2de43190 100644
--- a/app/components/trns/List.vue
+++ b/app/components/trns/List.vue
@@ -208,7 +208,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
<!-- Group Sum -->
<div
v-if="isShowGroupSum && paginatedTrnsIds.length > 1"
- class="border-b border-item-4 pb-2 pr-3"
+ class="border-b border-item-4 pb-2 pr-3 opacity-60"
>
<Amount
v-if="getTotalOfTrnsIds(paginatedTrnsIds).income !== 0"
@@ -217,7 +217,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
:isShowBaseRate="false"
:type="1"
colorize="income"
- variant="base"
+ variant="sm"
/>
<Amount
@@ -227,7 +227,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
:isShowBaseRate="false"
:type="0"
isShowMinus
- variant="base"
+ variant="sm"
/>
</div>
@@ -251,11 +251,11 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
<div
v-for="(groupTrnsIds, date) in groupedTrns"
:key="date"
- class="_bg-item-2 _rounded-lg overflow-hidden border-b border-item-4 pb-2 last:border-b-0 last:pb-px"
+ class="_bg-item-2 _rounded-lg _border-b overflow-hidden border-item-4 pb-2 last:border-b-0 last:pb-px"
>
<div
:class="{ 'border-item-4': isShowGroupSum && groupTrnsIds.length > 1 }"
- class="flex items-end gap-2 px-3 py-2 pb-1"
+ class="flex items-end gap-2 px-3 py-1"
>
<DateTrns
:date="+date"
@@ -265,7 +265,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
<!-- Group Sum -->
<div
v-if="isShowGroupSum && groupTrnsIds.length > 1"
- class="pb-2"
+ class="pb-2 opacity-60"
>
<Amount
v-if="getTotalOfTrnsIds(groupTrnsIds).income !== 0"
@@ -274,7 +274,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
:isShowBaseRate="false"
:type="1"
colorize="income"
- class="text-4"
+ variant="sm"
/>
<Amount
@@ -284,7 +284,7 @@ const groupedTrns = computed(() => paginatedTrnsIds.value
:isShowBaseRate="false"
:type="0"
isShowMinus
- class="text-4"
+ variant="sm"
/>
</div>
</div>
diff --git a/app/components/ui/HeaderTitle.vue b/app/components/ui/HeaderTitle.vue
index 208d9123..eb572d0c 100644
--- a/app/components/ui/HeaderTitle.vue
+++ b/app/components/ui/HeaderTitle.vue
@@ -1,8 +1,8 @@
<template>
<div
class="
- @lg:text-xl font-tertiary text-3 flex min-h-[30px] grow items-center gap-2 px-0.5 text-lg font-semibold
- leading-none tracking-wide
+ @lg:text-xl flex min-h-[30px] grow items-center gap-2 px-0.5 font-tertiary text-lg font-semibold leading-none
+ tracking-wide text-3
"
>
<slot />
diff --git a/app/components/ui/Logo.vue b/app/components/ui/Logo.vue
index 3bb3885d..7b127594 100644
--- a/app/components/ui/Logo.vue
+++ b/app/components/ui/Logo.vue
@@ -1,5 +1,5 @@
<template>
- <div class="font-brand first-letter:text-accent-1 text-2xl font-bold">
+ <div class="font-brand text-2xl font-bold first-letter:text-accent-1">
{{ $t('appName') }}
</div>
</template>
diff --git a/app/components/ui/Title8.vue b/app/components/ui/Title8.vue
index f64683e2..711e3a6b 100644
--- a/app/components/ui/Title8.vue
+++ b/app/components/ui/Title8.vue
@@ -13,7 +13,7 @@ const emit = defineEmits<{
<template>
<div
:class="getStyles('item', ['link', 'center', 'padding3', 'minh2', 'minw1', 'rounded'])"
- class="flex grow items-center gap-2 pb-0 !font-tertiary !text-base font-semibold leading-none !text-1"
+ class="flex grow items-center gap-2 pb-0 !font-tertiary !text-base font-semibold leading-none tracking-wide !text-1"
@click="emit('click')"
>
<div><slot /></div>
diff --git a/app/components/wallets/Item.vue b/app/components/wallets/Item.vue
index 370fc834..93796490 100644
--- a/app/components/wallets/Item.vue
+++ b/app/components/wallets/Item.vue
@@ -81,7 +81,7 @@ if (!props.isSort) {
<!-- Main -->
<template v-if="!props.alt">
<div class="grid grow gap-1">
- <div class="text-3 text-sm leading-none">
+ <div class="text-sm leading-none text-3">
{{ wallet.name }}
</div>
@@ -130,7 +130,7 @@ if (!props.isSort) {
</div>
<div
- class="pr-1 opacity-90"
+ class="pr-1"
:class="{
'text-accent-2': creditAmount > 0,
'text-accent-1': creditAmount < 0,
@@ -141,12 +141,14 @@ if (!props.isSort) {
:amount="creditAmount"
:currencyCode="wallet.currency"
:isShowBaseRate="props.isShowBaseRate"
+ variant="sm"
/>
<Amount
v-else
:amount="wallet.amount"
:currencyCode="wallet.currency"
:isShowBaseRate="props.isShowBaseRate"
+ variant="sm"
/>
</div>
</template>
@@ -154,7 +156,7 @@ if (!props.isSort) {
<!-- Alternative -->
<template v-if="props.alt">
<div class="grid grow gap-0.5">
- <div class="text-2 whitespace-nowrap text-xs leading-none">
+ <div class="whitespace-nowrap text-xs leading-none text-2">
{{ wallet.name }}
</div>
@@ -182,7 +184,7 @@ if (!props.isSort) {
<div
v-if="isSort"
- class="sortHandle flex-center group-hocus:bg-item-5 absolute right-0 h-full rounded-md px-3"
+ class="sortHandle flex-center absolute right-0 h-full rounded-md px-3 group-hocus:bg-item-5"
>
<Icon name="lucide:grip-vertical" size="20" />
</div>
diff --git a/app/components/wallets/Statistics.vue b/app/components/wallets/Statistics.vue
index 349e598e..fedf1510 100644
--- a/app/components/wallets/Statistics.vue
+++ b/app/components/wallets/Statistics.vue
@@ -30,7 +30,7 @@ const itemsGrouped = computed(() => [
:initStatus="true"
:lineWidth="0"
:storageKey="props.storageKey"
- class="_border mb-2 rounded-xl border-item-4 bg-item-2 md:max-w-lg"
+ class="mb-2 rounded-xl bg-item-2 md:max-w-lg"
>
<template #header="{ toggle, isShown }">
<div class="flex grow items-center justify-between">
@@ -67,11 +67,13 @@ const itemsGrouped = computed(() => [
<Amount
:amount="item.secondValue - Math.abs(item.value)"
:currencyCode="currencyCode"
+ variant="2xs"
/>
<div>/</div>
<Amount
:amount="item.secondValue"
:currencyCode="currencyCode"
+ variant="2xs"
/>
</div>
</div>
@@ -80,6 +82,7 @@ const itemsGrouped = computed(() => [
<Amount
:amount="item.value"
:currencyCode="currencyCode"
+ variant="sm"
/>
</div>
</UiElement>
diff --git a/app/components/wallets/page/List.vue b/app/components/wallets/page/List.vue
index 37ca7a02..cf1ebf53 100644
--- a/app/components/wallets/page/List.vue
+++ b/app/components/wallets/page/List.vue
@@ -660,11 +660,12 @@ function countWalletsSum(
{{ groupedBy === 'type' ? t(`money.types.${groupPrimary}`) : groupPrimary }}
</div>
- <div class="ml-auto">
+ <div class="ml-auto opacity-60">
<Amount
:amount="countWalletsSum(content.ids)"
:currencyCode="currenciesStore.base"
:isShowBaseRate="false"
+ variant="sm"
/>
<Amount
v-if="groupedBy === 'currency' && currenciesStore.base !== groupPrimary"