Skip to content

Commit

Permalink
components(form-row): refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Mar 30, 2024
1 parent d28ea2a commit 663fce9
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions components/form-row.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<v-row
:class="{'vh-form-row--horizontal': props.direction === 'horizontal'}"
:class="{'horizontal': props.direction === 'horizontal'}"
no-gutters=""
class="vh-form-row flex-column flex-sm-row">
<v-col class="vh-form-row__label-col">
class="flex-column flex-sm-row">
<v-col>
<template v-if="props.label">
<label>
{{ props.label }}
Expand All @@ -12,7 +12,7 @@
</v-col>

<v-col>
<slot />
<slot v-if="$slots.default" />
</v-col>
</v-row>
</template>
Expand All @@ -33,20 +33,19 @@ const props = defineProps({
<style lang="scss" scoped="">
@import "~vuetify/src/components/VTextField/_variables.scss";
.vh-form-row {
$self: &;
gap: var(--vh-form-row-gap);
.row {
--vh-form-row-gap: .375rem;
--vh-form-row-label-col-width: 100%;
--vh-form-row-label-justify-content: flex-start;
&--horizontal {
gap: var(--vh-form-row-gap);
&.horizontal {
@media #{map-get($display-breakpoints, "sm-and-up")} {
--vh-form-row-gap: 1rem;
--vh-form-row-label-col-width: 170px; // Optimized for "TRT bandrolü (€20,00)" text
--vh-form-row-label-justify-content: flex-end
}
}
&__label-col {
.col:first-child {
flex: 0 0 var(--vh-form-row-label-col-width);
max-width: var(--vh-form-row-label-col-width);
label {
Expand All @@ -56,8 +55,5 @@ const props = defineProps({
justify-content: var(--vh-form-row-label-justify-content)
}
}
:deep(.v-input__append-outer) {
margin-block-start: 0 !important
}
}
</style>

0 comments on commit 663fce9

Please sign in to comment.