💄(react) disable default Modal text align center

This default behavior was causing lots of troubles when using modals.
For instance the Select value were centered, it was also the case for
most of consumer's component inside modals, forcing the users to
set text-align:left on their side, resulting in additionnal work.
Now we use another approach by using a specific div for the content
we want centered.
This commit is contained in:
Nathan Vasse
2024-05-14 16:33:23 +02:00
committed by NathanVss
parent 582027f22a
commit e53cc730fc
5 changed files with 19 additions and 4 deletions

View File

@@ -33,7 +33,9 @@ export const ConfirmationModal = ({
}
{...props}
>
{children ?? t("components.modals.helpers.confirmation.children")}
<div className="c__modal__content__text">
{children ?? t("components.modals.helpers.confirmation.children")}
</div>
</Modal>
);
};

View File

@@ -38,7 +38,10 @@ export const DeleteConfirmationModal = ({
}
{...props}
>
{children ?? t("components.modals.helpers.delete_confirmation.children")}
<div className="c__modal__content__text">
{children ??
t("components.modals.helpers.delete_confirmation.children")}
</div>
</Modal>
);
};

View File

@@ -41,7 +41,9 @@ export const MessageModal = ({
}
{...props}
>
{children ?? t("components.modals.helpers.disclaimer.children")}
<div className="c__modal__content__text">
{children ?? t("components.modals.helpers.disclaimer.children")}
</div>
</Modal>
);
};

View File

@@ -72,7 +72,6 @@
}
&__content {
text-align: center;
font-size: var(--c--components--modal--content-font-size);
font-weight: var(--c--components--modal--content-font-weight);
color: var(--c--components--modal--content-color);
@@ -80,6 +79,10 @@
&:focus-visible {
outline: none;
}
&__text {
text-align: center;
}
}
&__close {