Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion packages/fxa-react/styles/ctas.css
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
/* Max-height is a likely temp "hack" for .spinner until it's converted to TW */
/* font-color is also a hack until all buttons are TWified */
.cta-xl {
@apply flex-1 font-bold text-base p-4 rounded-md;
/* grow without shrinking — prevents CJK labels breaking one character per line */
@apply grow shrink-0 basis-0 font-bold text-base p-4 rounded-md;
}

.cta-caution {
Expand Down Expand Up @@ -202,3 +203,21 @@
}
}
}

@layer utilities {
/*
* Flex children default to flex-shrink: 1, which squeezes CJK button labels
* to one character per line in settings rows and modals. Higher specificity
* than the flex-1 utility ensures shrink-0 wins when both are present.
*/
button.cta-neutral,
a.cta-neutral,
button.cta-primary,
a.cta-primary,
button.cta-caution,
a.cta-caution,
button.cta-primary-cms,
a.cta-primary-cms {
@apply shrink-0 whitespace-nowrap;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export const Modal = ({
{children}

{hasButtons && (
<div className="flex justify-center mx-auto mt-6 max-w-64">
<div className="flex flex-wrap justify-center gap-2 mx-auto mt-6 max-w-64">
{hasCancelButton && (
<FtlMsg id="modal-cancel-button">
<button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ const PasskeyDeleteModal = ({
using a different way.
</p>
</FtlMsg>
<div className="flex justify-center mx-2 mt-6">
<div className="flex flex-wrap justify-center gap-2 mx-2 mt-6">
<FtlMsg id="passkey-delete-modal-cancel-button">
<button
className="cta-neutral mx-2 flex-1 cta-xl"
Expand Down
5 changes: 5 additions & 0 deletions packages/fxa-settings/src/styles/unit-row.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@

&-actions {
@apply w-full items-baseline mt-2;

a[class*='cta-'],
button[class*='cta-'] {
@apply shrink-0 whitespace-nowrap;
}
}

&-hr {
Expand Down
Loading