Skip to content

Open source personal finance application

Add "medium" option for Icon, refactor styles

ilkome4418fe97c17d
diff --git a/src/components/icon/Icon.vue b/src/components/icon/Icon.vue
index e80c3f64..94292aa1 100644
--- a/src/components/icon/Icon.vue
+++ b/src/components/icon/Icon.vue
@@ -29,6 +29,10 @@ export default {
type: Boolean,
default: false
},
+ medium: {
+ type: Boolean,
+ default: false
+ },
big: {
type: Boolean,
default: false
@@ -46,6 +50,7 @@ export default {
_category: this.category,
_invert: this.invert,
_round: this.round,
+ _medium: this.medium,
_small: this.small
}
}
@@ -54,19 +59,19 @@ export default {
</script>
<template lang="pug">
- .icon(
- :class="className"
- :style="{ background, color }")
- //- wallet
- template(v-if="abbr")
- .icon__abbr {{ abbr.substring(0, 2) }}
- //- category
- template(v-else)
- .icon__image
- template(v-if="icon")
- div(:class="icon")
- template(v-else)
- .mdi.mdi-chart-bubble
+.icon(
+ :class="className"
+ :style="{ background, color }")
+ //- wallet
+ template(v-if="abbr")
+ .icon__abbr {{ abbr.substring(0, 2) }}
+ //- category
+ template(v-else)
+ .icon__image
+ template(v-if="icon")
+ div(:class="icon")
+ template(v-else)
+ .mdi.mdi-chart-bubble
</template>
<style lang="stylus" scoped>
@@ -77,30 +82,24 @@ export default {
display flex
align-items center
justify-content center
- width 36px
- height 36px
+ width 32px
+ height 32px
color var(--c-font-1)
border-radius 3px
-
- @media $media-laptop
- width 32px
- height 32px
-
&._invert
color var(--c-font-5)
background var(--c-bg-10)
-
- &._big
- width 48px
- height 48px
-
&._round
border-radius 50%
-
&._small
- width 20px
- height 20px
-
+ width 18px
+ height 18px
+ &._medium
+ width 24px
+ height 24px
+ &._big
+ width 48px
+ height 48px
&._category
width auto
height auto
@@ -110,22 +109,20 @@ export default {
&__image
font-size 20px
-
+ ^[0]._small &
+ font-size 14px
+ ^[0]._medium &
+ font-size 14px
+ ^[0]._big &
+ font-size 24px
^[0]._category &
font-size 32px
^[0]._category._small &
font-size 18px
- ^[0]._big &
- font-size 24px
-
&__abbr
- font-size 14px
-
- @media $media-laptop
- font-size 12px
- font-weight 500
-
+ font-size 12px
+ font-weight 500
^[0]._small &
- font-size 12px
+ font-size 11px
</style>