Skip to content

Commit

Permalink
remove default margin from base field
Browse files Browse the repository at this point in the history
  • Loading branch information
Haberkamp committed Sep 25, 2024
1 parent 07e243a commit 82a8128
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-teachers-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware-ag/meteor-component-library": patch
---

Remove default margin from base field, hidden by future flag
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="mt-field" :class="classes">
<div class="mt-field" :class="{ ...classes, ...fieldClasses }">
<div class="mt-field__label">
<mt-inheritance-switch
v-if="isInheritanceField"
Expand Down Expand Up @@ -51,14 +51,15 @@
</template>

<script lang="ts">
import { defineComponent } from "vue";
import { computed, defineComponent } from "vue";
import MtInheritanceSwitch from "../mt-inheritance-switch/mt-inheritance-switch.vue";
import MtFieldCopyable from "../mt-field-copyable/mt-field-copyable.vue";
import MtHelpText from "../../mt-help-text/mt-help-text.vue";
import useEmptySlotCheck from "../../../../composables/useEmptySlotCheck";
import MtValidationMixin from "../../../../mixins/validation.mixin";
import MtFormFieldMixin from "../../../../mixins/form-field.mixin";
import { createId } from "../../../../utils/id";
import { useFutureFlags } from "@/composables/useFutureFlags";
export default defineComponent({
name: "MtBaseField",
Expand Down Expand Up @@ -234,8 +235,14 @@ export default defineComponent({
setup() {
const { hasSlotContent } = useEmptySlotCheck();
const future = useFutureFlags();
const fieldClasses = computed(() => ({
"mt-field--future-remove-default-margin": future.removeDefaultMargin,
}));
return {
hasSlotContent,
fieldClasses,
};
},
});
Expand All @@ -251,6 +258,10 @@ $mt-field-transition:
width: 100%;
margin-bottom: 32px;
&.mt-field--future-remove-default-margin {
margin-bottom: 0;
}
.mt-field__help-text {
margin-left: 4px;
align-self: center;
Expand Down

0 comments on commit 82a8128

Please sign in to comment.