Skip to content

Commit

Permalink
Font Library: buttons position and accessibility (#58212)
Browse files Browse the repository at this point in the history
* move checkbox controls closer to the font faces previews

* make delete button red
  • Loading branch information
matiasbenedetto committed Jan 25, 2024
1 parent 609106d commit 9508cc0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Expand Up @@ -39,15 +39,15 @@ function CollectionFontVariant( {
className="font-library-modal__library-font-variant"
htmlFor={ checkboxId }
>
<Flex justify="space-between" align="center" gap="1rem">
<FontFaceDemo fontFace={ face } text={ displayName } />
<Flex justify="flex-start" align="center" gap="1rem">
<CheckboxControl
checked={ selected }
onChange={ handleToggleActivation }
__nextHasNoMarginBottom={ true }
id={ checkboxId }
label={ false }
/>
<FontFaceDemo fontFace={ face } text={ displayName } />
</Flex>
</label>
);
Expand Down
Expand Up @@ -191,11 +191,15 @@ function Footer( { shouldDisplayDeleteButton, handleUninstallClick } ) {
const { saveFontFamilies, fontFamiliesHasChanges, isInstalling } =
useContext( FontLibraryContext );
return (
<HStack justify="space-between">
<HStack justify="flex-end">
{ isInstalling && <ProgressBar /> }
<div>
{ shouldDisplayDeleteButton && (
<Button variant="tertiary" onClick={ handleUninstallClick }>
<Button
isDestructive
variant="tertiary"
onClick={ handleUninstallClick }
>
{ __( 'Delete' ) }
</Button>
) }
Expand Down
Expand Up @@ -49,15 +49,15 @@ function LibraryFontVariant( { face, font } ) {
className="font-library-modal__library-font-variant"
htmlFor={ checkboxId }
>
<Flex justify="space-between" align="center" gap="1rem">
<FontFaceDemo fontFace={ face } text={ displayName } />
<Flex justify="flex-start" align="center" gap="1rem">
<CheckboxControl
checked={ isInstalled }
onChange={ handleToggleActivation }
__nextHasNoMarginBottom={ true }
id={ checkboxId }
label={ false }
/>
<FontFaceDemo fontFace={ face } text={ displayName } />
</Flex>
</label>
);
Expand Down

0 comments on commit 9508cc0

Please sign in to comment.